Download & Extend

"Only variables can be passed by reference" to file_check_directory()

Project:Drupal core
Component:base system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.)

AttachmentSizeStatusTest resultOperations
file_create_path.diff2.4 KBIgnored: Check issue status.NoneNone

Comments

#1

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.

#2

Version:4.6.2» x.y.z

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.

AttachmentSizeStatusTest resultOperations
user.module_5.patch911 bytesIgnored: Check issue status.NoneNone

#3

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

AttachmentSizeStatusTest resultOperations
modules_1.patch2.13 KBIgnored: Check issue status.NoneNone

#4

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.

AttachmentSizeStatusTest resultOperations
modules_2.patch4.6 KBIgnored: Check issue status.NoneNone

#5

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.

#6

Status:reviewed & tested by the community» fixed

Committed to HEAD. Thanks.

#7

Status:fixed» reviewed & tested by the community

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

AttachmentSizeStatusTest resultOperations
references45.diff3.76 KBIgnored: Check issue status.NoneNone

#8

Patch for 4.6.

AttachmentSizeStatusTest resultOperations
references46.diff4.57 KBIgnored: Check issue status.NoneNone

#9

Status:reviewed & tested by the community» fixed

Committed to HEAD.

#10

#11

Status:fixed» closed (fixed)