I have recently deployed an update to a staging site where-by I am completely unable to get hook_menu()
to re-evaluate. The hook already existed before the update and was providing one item. After the update it should provide 2 items however no matter what I cannot get the hook to fire.
The new code works fine on my local dev environment of Ubuntu/LAMP however the staging platform is IIS7 / PHP FastCGI.
I have tried clearing the cache by sys>dev>performance, by the various links provided by the admin menu, by cache_clear_all()
and drupal_flush_all_caches()
in index.php
.
I've tried stopping/starting/restarting IIS.
There doesn't appear to be any running opcode caching as far as I can tell from phpinfo()
, no relevant mentions of "cache" or "apc".
I've added die()
commands into the mymodule_menu()
code and it seems that the hook is not firing at all. The menu_router table receives no new entry, although it retains the single previously-existing menu item.
I know the module is running as I can put die()
into the previously existing menu item's page callback and it kills PHP.
I also know that new hooks have been evaluated as the same code update provided also provides a mymodule_page_alter()
hook which fires successfully.
Starting to reach the end of my tether! What else can I try?
EDIT:
Another thing I've done is prove that mymodule_hook()
is named correctly. I've run <?php print_r(mymodule_menu()); ?>
through a PHP filter and it outputs the menu items array as expected.
EDIT:
Also I just tried <?php print_r(module_implements('menu')); ?>
through a PHP filter and I can see mymodule
in the array.
EDIT:
My hook_menu
implementation:
/**
* Implements hook_menu().
*/
function mymodule_menu() {
$items = array();
$items['google-search'] = array(
'page callback' => 'mymodule_google_search_page',
'access callback' => TRUE,
'title' => 'Search Results'
);
$items['mymodule-header-footer'] = array(
'page callback' => 'mymodule_header_footer',
'access callback' => TRUE,
'title' => 'Header and Footer'
);
return $items;
}
From the above /google-search
worked before and continues to work. /mymodule-header-footer
is the offending item.