Parameter 1 to admin_menu_admin_menu() expected to be a reference
| Project: | Administration menu |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
As noted on #589156: Warnings on PHP 5.3 (and XAMPP) there seams to be an issue when working on PHP 5.3 which triggers the following error:
warning: Parameter 1 to admin_menu_admin_menu() expected to be a reference, value given in /Users/Moritz/Documents/Projekte/Migipedia/Code/lib/drupal-6.14/includes/module.inc on line 471.
I just tried to analyze the calling function in Drupal 6.14 core and I don't see the need to get the parameter being passed by reference to admin_menu_admin_menu. I just tried to remove the "&" and everything seams to work as expected. (You can reproduce the bug by triggering "Wipe and rebuild" on admin/settings/admin_menu.)
Can you please check and review the attached patch?
Thanks
| Attachment | Size |
|---|---|
| admin_menu-6.x-1.5-admin_menu.inc_.patch | 370 bytes |

#1
Hi, came across this while looking into the admin_menu error I was seeing on php 5.3.
Unfortunately, I believe the "&" is needed for PHP 4, and D6 supports PHP 4. Ref a similar discussion regarding the Views module: http://drupal.org/node/452384#comment-2097968
#2
patch works for me (php 5.3)
#3
This variable still needs to be altered by reference. We need to fix the caller and not use module_invoke_all. Please test the following patch.
#4
Yikes. I just spent several hours trying to figure out why the "create content" link was not appearing in the administration menu on fresh installs, and why the Drupal icon menu was not working at all. It looks like this was the culprit. Installed the patch and this did the trick!
#5
Thanks Dave. Works flawlessly.