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

danielc - June 30, 2005 - 00:44
Project:Drupal
Component:base system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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

AttachmentSize
file_create_path.diff2.4 KB

#1

drumm - August 16, 2005 - 23:08
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

m3avrck - September 8, 2005 - 17:45
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.

AttachmentSize
user.module_5.patch 911 bytes

#3

m3avrck - September 8, 2005 - 17:56

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

AttachmentSize
modules_1.patch 2.13 KB

#4

m3avrck - September 8, 2005 - 18:13

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.

AttachmentSize
modules_2.patch 4.6 KB

#5

Souvent22 - September 8, 2005 - 18:29

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

Dries - September 8, 2005 - 19:46
Status:reviewed & tested by the community» fixed

Committed to HEAD. Thanks.

#7

danielc - September 9, 2005 - 02:53
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

AttachmentSize
references45.diff 3.76 KB

#8

danielc - September 9, 2005 - 02:53

Patch for 4.6.

AttachmentSize
references46.diff 4.57 KB

#9

Dries - September 9, 2005 - 06:14
Status:reviewed & tested by the community» fixed

Committed to HEAD.

#10

Anonymous - September 23, 2005 - 06:31

#11

Anonymous - October 7, 2005 - 06:40
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.