Issues with passing-by-reference the $form_state parameter to form_alter methods.

The following are warnings displayed on my user/:id/edit page and admin/settings/onepageprofile page:

warning: Parameter 2 to nodecomment_form_alter() expected to be a reference, value given in /Applications/MAMP/htdocs/singlebrook/virtual_workshop/includes/common.inc on line 2892.
warning: Parameter 2 to i18nmenu_form_alter() expected to be a reference, value given in /Applications/MAMP/htdocs/singlebrook/virtual_workshop/includes/common.inc on line 2892.
warning: Parameter 2 to rules_forms_form_alter() expected to be a reference, value given in /Applications/MAMP/htdocs/singlebrook/virtual_workshop/includes/common.inc on line 2892.

Naturally, these will be slightly different depending on the form_alter implementations on different modules.

CommentFileSizeAuthor
#2 php5.3incompatibilities-1123782-corrected.patch782 bytesAnonymous (not verified)
#1 php5.3incompatibilities-1123782.patch977 bytesAnonymous (not verified)

Comments

Anonymous’s picture

StatusFileSize
new977 bytes
Anonymous’s picture

Small bug in last one with variable names. This patch is correct. Uses http://drupal.org/node/705512 as starting point for fix.

etomilin’s picture

Patch #2 worked fine for me.

roball’s picture

Status: Active » Reviewed & tested by the community

Patch from #2 perfectly fixes all those problems.

I was hit by the PHP errors

Parameter 2 to webfm_form_alter() expected to be a reference, value given in /usr/share/drupal6/includes/common.inc on line 2892.

and

Parameter 2 to wysiwyg_form_alter() expected to be a reference, value given in /usr/share/drupal6/includes/common.inc on line 2892.

when viewing my user's profile page (user/[UID]), when the modules "WebFM" and "Wysiwyg" are enabled.

Please commit the patch, thanks!

roball’s picture

Version: 6.x-1.9 » 6.x-1.11
aidanlis’s picture

I think this was fixed in #901444: PHP notice by not passing $form['#id'], apologies for leaving the queue so unmaintained that this became a problem.

aidanlis’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Patch in #2 didn't work for me in Drupal 6.25 - but the other one did - http://drupal.org/node/901444#comment-3557256

roball’s picture

This bug has already been fixed in the current version (6.x-1.13). No need to patch!!