This patch fixes the php 5.3 reference warning.
Please check to make sure this is a safe change.

CommentFileSizeAuthor
cck-6.x-2.6-php53-1.patch1.05 KBthekevinday
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thekevinday’s picture

I want to emphasize: Please make sure that it is safe for me to remove the & at this location.

thekevinday’s picture

My patch may not be the correct fix, see my post here:
http://drupal.org/node/360605#comment-2340170

Berdir’s picture

See #649132-3: php 5.3, this should not be necessary.

markus_petrux’s picture

Title: PHP 5.3 » Fix content_copy_form_alter(), where $form_state argument is not passed by reference
Status: Active » Fixed

Regardless of the fact that it could be a PHP 5.3 issue too, hook_form_alter() can only modify the first argument, so $form_state should not be declared as a by reference argument.

Fix committed to CVS. Thanks!

http://drupal.org/cvs?commit=297962 (CCK2)
http://drupal.org/cvs?commit=297966 (CCK3)

Berdir’s picture

Nope, that is not correct. drupal_alter contains a hack that allows to have more than one by reference argument, see the huge comment at http://api.drupal.org/api/function/drupal_alter/6 and how it's called at http://api.drupal.org/api/function/drupal_prepare_form/6.

Of course, if you don't need to change $form_state, it is perfectly fine to remove the &. It's just your statement that isn't correct :)

markus_petrux’s picture

Oops! You're right. Thanks for pointing this out. Anyway, content_copy_form_alter() does not need to modify the $form_state argument, so the patch should cause no harm.

Status: Fixed » Closed (fixed)

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

peternickson’s picture

Can someone please tell me how to apply the patch?