R – Drupal6: hook_menu_alter still having an effect after the module is disabled

cachingdrupal-6hookmenu

For some reason, the "Create content" menu item was displaying for Anon, even though there was nothing in that tree or at that path. (Anon can only create a certain type of content, but that has been moved to its own top-level navigation item.)

To solve this, I used hook_menu_alter():

/**
 * Remove "create content" from the menu if the user is anon
 */
function odp_menu_alter(&$items){
    global $user;
    if ($user->uid == 0) {
      unset($items['node/add']);
    } 
}

For some reason, this also influenced the superuser account. I disabled the module with that code. Now the Create Content link is back, but it leads to this error:

Fatal error: Unsupported operand types in modules\system\system.module on line 626

All the subtree links that were below Create Content still work.

I've flushed all the caches. What is happening?

Best Solution

What other third party modules do you have running? Sounds like there is a code bug somewhere, but that is awfully difficult to diagnose from here.

I would try posting on the Drupal issue queue.

Related Question