I am getting this at the top of every page with the module enabled:

Warning: Call-time pass-by-reference has been deprecated in /Library/WebServer/Documents/drupaldev/sites/all/modules/menu_stp/menu_stp.module on line 27

Warning: Call-time pass-by-reference has been deprecated in /Library/WebServer/Documents/drupaldev/sites/all/modules/menu_stp/menu_stp.module on line 27

CommentFileSizeAuthor
#18 menu_stp_508320.patch643 bytesgrendzy
#5 508320.patch1.73 KBgiorgosk

Comments

realityloop’s picture

I am getting this also

Marcel20’s picture

I have the same error using menu_stp on drupal-6.12-DE.

Marcel20’s picture

Did some investigations and as far as I understood this warning is caused by an old (php 4) style of method call using a reference. Found a similar problem somewhere else related to drupal which had been solved by replacing method call
method ( &$var )
by
method ( $var )
So I changed line 27 in menu_stp.module from
_menu_stp_form_alter_menu_edit_item(&$form, &$form_state, $form_id);
to
_menu_stp_form_alter_menu_edit_item($form, $form_state, $form_id);
And luckily it fixed that warning and menu_stp does still work correctly :-)

not_Dries_Buytaert’s picture

@Marcel20: I successfully tested your solution. Thx!
Please, can anyone incorporate this in the next release?

giorgosk’s picture

Status: Active » Needs review
StatusFileSize
new1.73 KB

Please review this patch before the maintainer commits it

drasgardian’s picture

Issue tags: +PHP 5.3

tested and worked ok here.

Should mention that the bug would only be appearing when using php 5.3

game’s picture

I too am getting this error and am hosting the development site on a Windows Server 2008 R2 IIS7 box which logs the error and displays an error 500 when you try to browse the site. I will try the patch also so thanks for that but would love the maintainer to resolve this issue in the next release :-)

Thanks all

game’s picture

After applying the patch I can now browse the site again and the module is enabled however i cant see any options for setting this, I have followed the documentation but still am not seeing from within the menu items edit page a selection for me to add roles :-/ any ideas on this? Im using the latest ver of Drupal 6, I should also say im running the latest version of PHP5.2.

Any help would be great

Thanks

game’s picture

problem resolved simply changed line 27 :-)

giorgosk’s picture

@GAMe
please explain what is wrong with the patch ?
what did you change ?
what system are you using ?

maybe it will be helpful to others

willowdan’s picture

Thanks a lot. This helped me and my project .. so, this deprecated ways should be noted.
http://dantejarablo.com

greg.harvey’s picture

Status: Needs review » Reviewed & tested by the community

+1, patch works.

game’s picture

Hi

I simply followed comment #3 :-)

berdir’s picture

The patch removes the & from the function definition. I haven't tried it, but that looks wrong to me, since that makes it impossible for the hook_form_alter() to change $form/$form_state. And after all, that's the sole purpose of that function :)

Instead, you should only remove the & when the function is called, that should be enough. In short, the change on line 27.

greg.harvey’s picture

Status: Reviewed & tested by the community » Needs work

By golly, you're right! Good spot.

All the *other* references need stripping, but not the hook_form_alter one!

berdir’s picture

All function definitions need their &, since they are called from within hook_form_alter since they have to modify $form and $form_state too :)

markchitty’s picture

Any news on this patch ? The latest release and the dev release are identical. cheers.

grendzy’s picture

Status: Needs work » Needs review
StatusFileSize
new643 bytes

corrected patch

graduns-1’s picture

Status: Needs review » Reviewed & tested by the community

I tested this, and I'm extremely surprised this version of the component made it this long without being patched on something as major as this.

sime’s picture

Tested #18. All good. Also running 5.2, this is a pretty straight-forward fix.

psych0hans’s picture

Hi, my error is "Warning: Call-time pass-by-reference has been deprecated in /home/content/76/6427676/html/erp/sites/default/modules/erp/erp_stock/erp_stock.module on line 743"
you can find the php code in the link below. Can I apply the above solution to this?

http://ideone.com/8ZjIU

lucascaro’s picture

patch from #18 is correct. should we mar it as reviewed so it gets in the next release?

sime’s picture

Issue tags: -PHP 5.3

#21 @psych0hans - your problem has the same error, but it is a problem in the ERP module. You should create an issue in the ERP issue queue to get this fixed.

#22 @lucascaro - yes, it is already marked "reviewed and tested", now we just wait for the maintainer to look at this and hopefully commit the fix. :)

ling19’s picture

Hi,
#3 works for me. Thanks! :)