Closed (cannot reproduce)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Mar 2018 at 10:10 UTC
Updated:
4 Nov 2021 at 10:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ReBa commentedIn the Dev version, this problem still occurs.
I've created a patch that doesn't generate a fatal error.
Please test & review
Comment #4
tr commentedWell, first, not critical. Works perfectly on everything but PHP 7.2, and even Drupal core doesn't work on PHP 7.2 yet. Just a normal issue.
Second, not a bug report. Sure, we should support PHP 7.2, but PHP has changed since the Rules code was written so this is not something that was done "wrong" in Rules, it's just that PHP has redefined what "wrong" is in 7.2. PHP 7.2 didn't exist 8 years ago when D7 was written, so this is a "task" to keep up with the most recent version of PHP.
And BTW, that's really funny what you did, quoting OOP theory when talking about PHP. PHP is a joke in the OO world, and while it's gradually improving, things like the above error complains about have been standard in all mainstream OO languages for more than 25 years already. It's not something to be proud about that PHP is finally catching up on imposing some structure.
Third, what you're proposing was already fixed in #2923477: PHP 7.x compatibility issue, and what you're proposing is a revert of that. At least 7 different people tested that patch and found that it solved the Fatal Error on PHP 7.2. While you say "In the Dev version, this problem still occurs", you are wrong - the signature of RulesRuleUI::form() in the -dev version includes the $iterator parameter, so you cannot possibly be seeing the error message in your original post. Perhaps you see a similar message, however you did not post that other message. So while there may still be a similar problem in -dev, you haven't provided enough information for a fix. Regardless, removing the $iterator argument is NOT the correct solution, since $iterator is needed in some of the subclasses like RulesRuleUI.
Comment #5
tr commentedComment #6
albanaa commentedComment #7
mdmanouwer commentedabove patch when i applied to my repository it fixed the issue
thanks
Comment #8
heinz.wegener commentedUpdating to Rules 7.x-2.11 and Drupal 7.61 should solve the problem.
Comment #9
kwoxer commentedHi heinz.wegener. I have updated Rules and Drupal to that versions, but I still get this error message in frontend as well when using drush commands:
Comment #10
doostinharrell commentedI can also confirm that updating to Drupal 7.61 and Rules 7.x-2.11 when running PHP 7.2 resolves the issue.
Comment #11
beesol commentedyes same here core 7.61 and rules 7.x-2.11 on PHP 7.2 resolved
Comment #12
rakesh.gectcrYes, Drupal core - 7.64, rules 7.x-2.12 on PHP 7.2 resolved the issue.
Comment #13
izus commentedHello,
confirming these versions work well together
Drupal core - 7.65,
Rules - 7.x-2.12
PHP 7.2.16
Thanks
Comment #14
garrettw commentedI'm still getting this error. PHP 7.2, Drupal 7, and Rules are all up to date on my end. It just took down one of my sites so I'll have to fix it and provide a patch shortly.
Comment #15
garrettw commentedScratch that -- the changes I made are the same as the patch at #5 in the related issue. Now what I want to know is how did I manage to not have that code if my Rules module was already at 2.12? So weird.
Comment #16
hunlaprovo commentedFatal error: Declaration of RulesConditionalEmptyUI::form(&$form, &$form_state, $options = Array) must be compatible with RulesContainerPluginUI::form(&$form, &$form_state, $options = Array, $iterator = NULL) in /home/httpd/www/example.hu/html/sites/all/modules/rules_conditional/includes/rules_conditional.ui.inc on line 56
I updated the rules module, but I also have the rules conditional error message. The module has not been updated since 2012. What can be done?
Comment #17
tr commentedYou need to contact the maintainer of the Rules Conditional module and post your problem in the issue queue for that module, but it looks to me like that problem was already fixed in the -dev release of Rules Conditional by issue #2959426: Incompatibility with PHP 7.2, so first try updating your copy of that module to see if the problem goes away.
Comment #18
sajosh commentedI just got this same error when upgrading a Drupal 7 site. I updated to Drupal 7.74, php 7.3 (because 7.4 causes depreciation errors to show up). Rules needed to be updated but I was updating down the list and I got this error.
To solve, I just updated the Rules module to 7.x-2.12, then the error went away. I continued updating other modules.
Comment #19
norman.lolHaving a site on PHP 5.6 I'm debugging right now. Rules 7.x-2.10. I can't execute any Drush command because of that error. Sounds critical to me.
Applying the attached patch fixes the issue for me.
Comment #20
tr commented@leymannx: This was FIXED in Rules more than THREE years ago - #2923477: PHP 7.x compatibility issue committed on 14 December 2017. The patch committed in that issue is identical to what you posted in #19.
The version of Rules you're using, 7.x-2.10, is almost FOUR years old. Both 7.x-2.11 and 7.x-2.12 include this fix. 7.x-2.10 is obsolete, can't be changed, and is no longer supported. Keep your modules and your version of core up-to-date and you won't have problems like this.
Comment #21
norman.lolTHANK YOU for telling me.
Comment #22
aswathyajish commentedThanks. Patch in #19 worked for me.
Comment #23
yaach commentedSame issue with PHP 7.4, Rules 7.x-2.10. Updated to 7.x-2.11 and error went away.