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')
->fields(array('weight' => 10000))
->condition('name', '[content_type_thumbnail]', '=')
->execute();
}
Function in commerce_backoffice_product module:
/**
* Implements hook_theme_registry_alter().
*/
function commerce_backoffice_product_theme_registry_alter(&$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(&$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;
}