Hi,
Today I had a very nasty 'shock' whilst developing a module for 6.2 and it took some time to figure out what had happened. To a newbie module developer this could be a catastrophic incident because the cause is not that obvious and the solution even less so.
SYMPTOM:
All menu routing and page requests result in a page not found error after the fault takes place.
CAUSE:
In the menu_router_build() function the DELETE statement is executed *before* the new set of callbacks have been produced, this means that a 'malicious' module could wipe out the entire menu router table and completely disable the operation of a site.
SUGGESTED RECOVERY:
Re-import the menu_router table from an SQL backup or a default installation which should restore the administrative functionality allowing further restorative actions to be undertaken.
HOW TO RE-CREATE:
Put a die statement in your hook_menu() implementation. I did this very innocently to see what was going on as I had some issues with what I was doing at the time.
SUGGESTED FIX / IMPROVEMENT:
The current implementation of menu_router_build() is as follows:
/**
* Collect, alter and store the menu definitions.
*/
function menu_router_build($reset = FALSE) {
static $menu;
if (!isset($menu) || $reset) {
if (!$reset && ($cache = cache_get('router:', 'cache_menu')) && isset($cache->data)) {