If I have two modules, each has implemented its preprocess_node hook. Then which one will be called first ? Is there anyway to enforce the order in which it would be called ?
module1_preprocess_node(&$vars){
$vars['submitted'] = "test1";
}
module2_preprocess_node(&$vars){
$vars['submitted'] = "test2";
}
I wonder which would be the result… test1, or test2.
Thanks in advance
All hooks in Drupal are fired in module-weight order. By default, all module’s have a weight of zero, so if you want to control the exact order they fire in, you need to change something in the database.
How to Update a Module’s Weight
If you look at the API docs for module_list(), ties break in alphabetical order of the filename of the .module file.