Conflict between with a function in two different modules I have the same function in two different modules to change the page: node/add. 

I need the second one(see below) to override the first one. I implemented hook_install to change their weight but is not working. My guess is that the hook_install function is executed after those modules.

How can get this done?

Codes below:

My hook_install function

/**
* Implements hook_install().
*/
function utilities_install(){

db_update('system')
    -&gt;fields(array('weight' =&gt; 10000))
    -&gt;condition('name', '[content_type_thumbnail]', '=')
    -&gt;execute();

}


Function in commerce_backoffice_product module:

 /**
 * Implements hook_theme_registry_alter().
 */
function commerce_backoffice_product_theme_registry_alter(&amp;$theme_registry) {
  $theme_registry['node_add_list']['function'] = 'theme_commerce_backoffice_product_node_add_list';
}

/**
 * Override node_add_list theme.
 */
function theme_commerce_backoffice_product_node_add_list($variables) {
  $item = menu_get_item();

   .... code ....

  return theme_node_add_list($variables);
}


Function in content_type_thumbnail module

/**
 * Implements hook_theme_registry_alter().
 */
function content_type_thumbnail_theme_registry_alter(&amp;$theme_registry) {
  $theme_registry['node_add_list']['function'] = 'content_type_thumbnail_node_add_list';
}

/**
 * Override of theme_node_add_list().
 */
function content_type_thumbnail_node_add_list($variables) {

  .... code ....

  return $output;
}
Rather than module weighting, I would suggest using hook_module_implements_alter to ensure your hook gets run last. So, something like this:

function hook_module_implements_alter(&amp;$implementations, $hook) {
  if ($hook == 'theme_registry_alter') {
    $group = $implementations['my_module'];
    unset($implementations['my_module']);
    $implementations['my_module'] = $group;
  }
}