"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.)
| Attachment | Size |
|---|---|
| file_create_path.diff | 2.4 KB |

#1
Patch still applies and does not cause any problems with PHP 4. I am unable to test on PHP 5.
#2
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 1366Rerolled patch against latest HEAD. system.module no longer needs to be updated, only user.module does.
#3
Correction, still applies in system.module, new patch attached.
#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.
#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
Committed to HEAD. Thanks.
#7
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
#8
Patch for 4.6.
#9
Committed to HEAD.
#10
#11