Jump to Navigation

Drupal: dealing with "Undefined index: access in _menu_translate()" errors

A headache shared by Drupal developers

    While working behind the scenes, getting the basic functionality on this site up and running, I've found that upon installing a few modules that I suddenly would get these errors:

Notice: Undefined index: access in _menu_translate() (line 778 of /path/to/server/includes/menu.inc).

Notice: Undefined index: access in menu_local_tasks() (line 1946 of /path/to/server/includes/menu.inc).

    And I have to tell you, the last thing I want my users to see when they log in is a long error block of these two lines repeating! Even worse are the random "white screens of death" (WSOD) that were popping up on my user profiles. I have found something that works, and hasn't been explained very well in the Drupal issue queues, so today I'd like to share my solution with you.

 

The problem

    I traced the problem to what appeared to be some module conflicts. It could be that a certain function was inappropriately being called multiple times. Or it could have been that two modules were trying to use the same data. Either way, the offending modules for me personally were OAuth and Panels. Fortunately, these two weren't required for me. While installed I would get several WSOD errors from various pages... at one point, the entire site became a WSOD. So I had to delete the modules. BUT... when you delete the modules directly from your website directory, there's a lot of junk files left over in your database.

 

The solution

    First, a dislaimer: I am not a developer, and you could break your site doing this, and I have no money-back guarantee that it will work. But it has worked for me, so if you're bold, try it.

  1. Back up your database, as you're going to make some edits. You want to be able to bring your database back in case you make a mistake. Backup and Migrate is a great module for this.

  2. Make a list of the modules you deleted.

  3. Remove the modules from sites/all/modules FIRST

  4. Go into your database using a program like phpmyadmin. Look for tables with a name like (database)_(module name)_(whatever). For example, I was looking for tables with "panels" in the name.

  5. Delete all of the offending tables.

  6. Go back into Drupal, and order the site to fluch all caches. This can also be done by clearing content in the database's cache tables, but do not delete the cache tables. I'd recommend letting Drupal do it right as opposed to doing it myself.

  7. Refresh the front page of your website! You're done!

If you've found a similar fix, why not comment on it? I'd be glad to hear from anyone who really gets Drupal on how to avoid this kind of pitfall and alternatives to fixing it.



Who's online

There are currently 0 users online.

Recent Content

Main menu 2

by Dr. Radut.