I have a site with some complex rules, including rules that schedule rules for later. The update to 2.1 has broken one of the rules, I don't know which, with the error message:
Argument 7 passed to rules_action_mail() must be an instance of RulesState, instance of RulesAction given
I'll keep digging to see if I can find where the problem is coming from.
Has also been reported on a Drupal Commerce site: #1496964: Recoverable fatal error rules_action_mail()
Comments
Comment #1
fonant commentedRules 2.0 has:
and the new Rules 2.1 with i18n has:
so the function signature has indeed changed. So we need to find where rules_action_mail() is being called and add an additional argument at position 5 for $langcode.
Comment #2
fonant commentedLooks like the function calls are stored in the serialized Rule data in the database. So we need some code to update that data to add in the additional $langcode argument for previously-stored rules.
Comment #3
fagoYou need to clear your caches, then it should work just fine.
Comment #4
fonant commentedThanks! The fix was as simple as that. Odd, as I thbought the caches had been cleared, but I can't have done.
Comment #6
phillipclarke29 commentedI have just started working on a site and the second rule, to notify node authors of a new comment using rules 7.x-2.2 has come up with the error
Recoverable fatal error: Argument 7 passed to rules_action_mail() must be an instance of RulesState, instance of RulesAction given in rules_action_mail() (line 78 of /opt/bitnami/apps/drupal/htdocs/sites/all/modules/rules/modules/system.eval.inc).
Looking a the previous posts I am still not sure what to do - I have tried clearing caches but it still does not work.
Comment #6.0
phillipclarke29 commentedAdded link to Commerce issue with same error.