pass-by-reference warning after enable - PHP 5.2(.6)

billybob4 - August 5, 2008 - 16:24
Project:WYMeditor
Version:5.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Trying out Drupal 5.9.

I installed jquery update 5.x-2.x and enabled it which is the prereq for WYMEditor 5.x.2.0 I believe.

Then installed WYMEditor 5.x.2.0 and enabled it.

Then received the following PHP warning:

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in C:\Web\WebServer\Apache22\htdocs\Drupal59\sites\all\modules\wymeditor\wymeditor.module on line 169

Can anyone shed light on this? I guess recent version of PHP may have changed a little?
Thanks

#1

jacobmn - August 14, 2008 - 02:41

I had this same issue and I determined the problem...

I quote this guy:

The classes do not pass arguments by reference.

If you are passing arguments by reference to the class functions, you do not need to do that. Just remove the & character from the function call arguments.

As such, go to line 169 of your wymeditor.module file and remove the ampersand from this line:

_wymeditor_input_format_alter(&$form[$key]);

It should then look like:

_wymeditor_input_format_alter($form[$key]);

And you are set. This should probably be a bug that gets fixed but I am not sure how to go about making that happen. Glad it was simple enough to fix anyhow.

#2

billybob4 - August 21, 2008 - 19:21

Lovely. Thanks for the tip :)

#3

billybob4 - September 22, 2008 - 01:36
Status:active» closed

#4

adrinux - December 10, 2008 - 15:26
Status:closed» needs review

I just hit this bug in wymeditor when moving my site from dev to live server, a whole section of the site white-screened :)

The full error message from apache's error log:

HP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /var/www/multi5/sites/all/modules/wymeditor/wymeditor.module on line 169, referer: http://dev.perlucida.com/admin/build/modules

This is on a server running debian etch, using the php package 5.2.0-8+etch13. It seems nonsensical to re-enable a deprecated feature when the fix is so trivial.

Attached is a patch for wymeditor 5.2, from browsing cvs it looks like this code has been re-written for the 6.x-dev version.

#5

adrinux - December 10, 2008 - 15:30

and of course the patch...[sighs]

AttachmentSize
wym-5-passbyref-1.patch 432 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.