Upgraded to 5.3 and the admin menu doesn't show up any more. html is not in the footer.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gavinblair’s picture

I'm having the exact same problem.

Parameter 1 to admin_menu_admin_menu() expected to be a reference, value given in /.../includes/module.inc on line 471.

UPDATE: There's a problem with calling date('Y') - this is chopping off the rest of the page, including the echo $closure, causing admin menu to not work (I think).

The error I'm getting from date('Y') is

warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier...

PGNetDev’s picture

subscribing ...

drasgardian’s picture

subscribing..

The date issue is probably not related to admin_menu though. You might just need to set the local timezone value in your php.ini

Dave Reid’s picture

Status: Active » Closed (won't fix)

1. admin_menu only calls gmdate() and doesn't use date, so that's not a related problem.
2. The only time admin_menu calls module_invoke_all() (from line 471 in includes/module.inc) there's no additional arguments and seems like it's a Drupal core PHP 5.3 bug:

./tests/admin_menu.test:117:    $permissions = module_invoke_all('perm');
./admin_menu.module:298:  $replacements = module_invoke_all('admin_menu_replacements');
./admin_menu.inc:412:      $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);

Marking as won't fix.

Island Usurper’s picture

Component: User interface » Code
Status: Closed (won't fix) » Needs review
FileSize
449 bytes

No, it's a valid issue, but fortunately the fix is easy. Drupal 6.14 changed the way some things work so that PHP 5.3 doesn't throw warnings all over the place any more. One of those things was that theme functions don't get parameters by reference.

This problem doesn't really show up until you clear the cache after upgrading PHP. After applying this patch, clearing the cache allowed admin_menu to appear again. I don't know if the code after theme_admin_menu_links() is relying on the by-reference behavior, but I haven't seen any side effects yet.

jdelaune’s picture

#5 works well. I'm still missing my 'create content' menu however... kind of annoying, maybe it's another issue but I suspect it's at php 5.3 issue.

jdelaune’s picture

Status: Needs review » Reviewed & tested by the community

nvm I've read that was intensional in 3.x

Good patch.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed to DRUPAL-6--3 CVS. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

aacraig’s picture

Just in case someone stumbles upon this as I did, I thought I'd point out that this issue was exacerbated for me by #549884: PHP 5.3 issue - Attempt to modify property of non-object (Date module).

Even after applying the patch in #5, admin_menu still was not showing up. After fixing the issue with the date plugin (as indicated in comment #10 on that page) the admin_menu suddenly appeared.

I'll also confirm that this seems to be a PHP 5.3 issue, as it cropped up when I updated my dev machine to Fedora 12 (and PHP 5.3). The live version of the site (an exact copy) was working just fine on a previous PHP version.

spam38’s picture

FileSize
1.04 KB

The problem is that $deleted is no longer being passed by reference in admin_menu_admin_menu(). Because of this, any changes to $deleted (like removing the Create Content submenu) aren't being passed back to the caller. I've create a patch that returns the modified $deleted in addition to the normal $links together in an array. Unfortunately, the patch does break the API since it changes what the function returns, but it seems to get the job done.

jonloh’s picture

Just upgrade it 6.x-3.x-alpha4. That solves the admin menu problem with PHP 5.3.0