Sorry I am a newbie to Drupal and PHP but I get this error whenever I try to create a new rule!
warning: Parameter 2 to rules_admin_form_edit() expected to be a reference, value given in C:\XAMPP\xampp\htdocs\drupal\includes\form.inc on line 372.
It may be a case realated to reported bugs about PHP 5.3.1 incompatability with Drupal 6. Eg:
http://drupal.org/node/360605#comment-2340170
http://drupal.org/node/588454#comment-2330908
I have installed everything in the last few days, including PHP 5.3.1. I did this based on the drupal installation guide, then added recommended modules.
I am trying to create a rule to clear a non-global flag (bookmark) on a node, but trying to add any rule gives me this warning, and then I cannot proceed.
As I am new to this, I would like to know how to workaround this, but also the Rules module may need updating.
So I am not sure if this is a support request or a bug report.
For the record, this lists the modules I have loaded on XAMPP
Drupal 6.15Includes: Block, Color, Comment, Database logging, Filter, Garland, Help, Menu, Node, Profile, Search, System, Taxonomy, Trigger, Update status, User
Modules
Up to dateComputed Field 6.x-1.0-beta3Includes: Computed Field
Up to dateContent Construction Kit (CCK) 6.x-2.6Also available: 6.x-3.x-dev (2010-Jan-26) DownloadRelease notes
Includes: Content, Content Copy, Content Permissions, Fieldgroup, Node Reference, Number, Option Widgets, Text, User Reference
Update availableFinder 6.x-1.6Recommended version: 6.x-1.7 (2010-Feb-02) DownloadRelease notes
Includes: Finder, Finder User, Finder Views
Up to dateFinder Wizard 6.x-3.0-beta2Includes: Finder Wizard
Up to dateFlag 6.x-1.2Also available: 6.x-2.0-beta2 (2010-Jan-08) DownloadRelease notes
Includes: Flag
Up to dateLocation 6.x-3.0Latest version: 6.x-3.1-rc1 (2009-Mar-04) DownloadRelease notes
Includes: Location, Location CCK
Up to dateRules 6.x-1.1Includes: Rules, Rules Administration UI, Rules Forms support, Rules Scheduler
Up to dateSimpleViews 6.x-1.0Includes: SimpleViews
Up to dateToken 6.x-1.12Includes: Token, TokenSTARTER
Up to dateViews 6.x-2.8Also available: 6.x-3.0-alpha2 (2010-Jan-26) DownloadRelease notes
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | rules_php53fixes2.patch | 1.49 KB | berdir |
| #6 | rules_php53fixes.patch | 881 bytes | berdir |
Comments
Comment #1
intotech commentedI have updated the XAMPP Simple Install instructions for Windows, to make it clearer the latest version includes an incompatible PHP version.
The Rules add rule function still needs updating as part of PHP5.3 compatibility.
I reinstalled an older version of XAMP and have got Rules working that way.
Comment #2
Sera commentedI got nearly the same error message/warning as written above when editing existing rules. So it's not just the add-rule function, but also edit, delete, etc of rules. E.g. when I want to edit a role, I get no other options, only the warning and cannot procede.
I would appreciate a fix for the module to make it compatible with PHP 5.3.x, as I can't downgrade the existing PHP version.
Simply removing all & from the &$ - arguments within the function call seems not to work.
Comment #3
jaochoo commentedI am having the same issue: Generally, all Rules related administration pages produce a bunch of warning: Parameter 1 to rules_forms_rules_import() expected to be a reference, value given in xampplite\htdocs\drupal\includes\module.inc on line 483. This does not seem to be a problem but just looks ugly; however, same as Sera above, I cannot edit existing Rules actions: The page will produce (in addition to the warnings mentioned already) the following warning and not procees to ouput anything else: warning: Parameter 2 to rules_admin_form_edit() expected to be a reference, value given in xampplite\htdocs\drupal\includes\form.inc on line 372.
Comment #4
stu21774 commentedSame. Newbie. Mid 2009 intel mac 10.6. Using existing php, apache. Drupal 6.15
Comment #5
mikejonesok commentedSame issue. Using 5.3
Comment #6
berdirConfirmed. From what I can see, the & isn't necessary. The function is only called from the menu system and that can never be called by reference.
Comment #8
spacereactor commentedi still getting warning: Parameter 1 to rules_forms_rules_import() expected to be a reference
Comment #9
berdirYes...
I'm not sure if the hook is supposed to be by reference, since it's 50% implements to be but documented to be not. But it doesn't make much sense to be not by reference, so I fixed the calling function and updated the documentation.
I also worked on the wrong version above, so ignore that patch, that has already been fixed.
Comment #10
mikejonesok commentedSeems to work. Thanks for the patch!
Comment #11
andrewfn commentedI am still getting the error:
warning:Parameter 2 to rules_admin_form_edit() expected to be a reference, value given in /opt/dr6/acquia/includes/form.inc on line 372.
Comment #12
spacereactor commentedUsing 6.x-1.1, when i try to edit Triggered rules. warning: Parameter 2 to rules_admin_form_edit() expected to be a reference, value given in C:\xampplite\htdocs\drupal\includes\form.inc on line 372.
After i upgrade to 6.x-1.x-dev and it seem to stop the error message with rules_php53fixes2.patch
Hope this help.
Comment #13
berdirYes, if you still see the rules_admin_form_edit() error, you are not using the -dev version.
Comment #14
andrewfn commentedInstalled the dev version and re-ran the patch. No more error messages!
Comment #15
fagoI committed fix from #9, thanks for the help tracking this down. Indeed the rule was never passed by reference.
Comment #16
Max K. commentedPatch fixed error for rules_admin_form_edit() but error persists for rules_forms_rules_import() from #3 with error:
warning: Parameter 1 to rules_forms_rules_import() expected to be a reference, value given in /var/www/html/includes/module.inc on line 483.
Comment #17
Max K. commentedI've found the problem. Simply removing the ampersand from rules_forms/rules_forms.module on line 151 eliminates the problem. The only piece of information being used is $rule['#set'], so no conflicts will arise, but it wastes a small amount of memory.
Comment #18
klausiRemoved the reference as suggested in #17 and committed it.