Parameter 1 to admin_menu_admin_menu() expected to be a reference

omo - October 26, 2009 - 18:19
Project:Administration menu
Version:6.x-1.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:reviewed & tested by the community
Description

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

AttachmentSize
admin_menu-6.x-1.5-admin_menu.inc_.patch370 bytes

#1

makemineatriple - October 31, 2009 - 09:42

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

JoepH - November 11, 2009 - 14:31

patch works for me (php 5.3)

#3

Dave Reid - November 11, 2009 - 15:25
Status:needs work» needs review

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.

AttachmentSize
615058-adminmenu-php53-D6-1.patch 885 bytes

#4

mayobutter - November 16, 2009 - 03:47

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

omo - November 22, 2009 - 00:57
Status:needs review» reviewed & tested by the community

Thanks Dave. Works flawlessly.

 
 

Drupal is a registered trademark of Dries Buytaert.