Call-time pass-by-reference has been deprecated
agerson - July 2, 2009 - 15:21
| Project: | Menu Subtree Permissions |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | PHP 5.3 |
Description
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

#1
I am getting this also
#2
I have the same error using menu_stp on drupal-6.12-DE.
#3
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 :-)
#4
@Marcel20: I successfully tested you solution. Thx!
Please, can anyone incorporate this in the next release?
#5
Please review this patch before the maintainer commits it
#6
tested and worked ok here.
Should mention that the bug would only be appearing when using php 5.3