A client of mine just upgraded to the latest snapshot of PHP 5.0.5-dev and started getting errors when file_check_directory() is called:

Fatal error: Only variables can be passed by reference in c:\drupal\modules\system.module on line 653

This patch fixes the problem by assigning the values to variables before passing them to file_check_directory().

Thanks.

(BTW: I'm no longer on on drupal-devel due to time constraints.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

Status: Needs review » Reviewed & tested by the community

Patch still applies and does not cause any problems with PHP 4. I am unable to test on PHP 5.

m3avrck’s picture

Version: 4.6.2 » x.y.z
FileSize
911 bytes

Confirmed, 5.0.5 final causes this fatal error: Fatal error: Only variables can be passed by reference in \drupal\modules\user.module on line 1366

Rerolled patch against latest HEAD. system.module no longer needs to be updated, only user.module does.

m3avrck’s picture

FileSize
2.13 KB

Correction, still applies in system.module, new patch attached.

m3avrck’s picture

FileSize
4.6 KB

Second and final correction, turns out there were *multiple* call by reference errors in system.module (some fixed in HEAD) others not. This patch corrects them all and correctly works with PHP 5.0.5 on second round of testing.

Souvent22’s picture

PHP Version 5.1.0b3

+1. Fixed all my errors for PHP5 regarding the "pass by refereance" error. I found 3 specific cases which generated the error, and now I have 0. Seems ready to go. For all who try this patch, please, as I did, place what version of PHP you're running, so we know it works for all 5.x.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

danielc’s picture

Status: Fixed » Reviewed & tested by the community
FileSize
3.76 KB

Attached is a patch for DRUPAL-4-5. I will attach a patch for DRUPAL-4-6 in a moment.

These patches, along with the one submitted by m3avrck, are a combination of three bug reports into one patch per branch. I will mark the following two items duplicates of this:

http://drupal.org/node/26235
http://drupal.org/node/26034

danielc’s picture

FileSize
4.57 KB

Patch for 4.6.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)