Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm not sure is it a bug with BOTCHA, or the Rules module, but since I haven't found anyone complaining about this issue on the Rules project, I suspect it might be a BOTCHA's issue. So, I created a rule:
{ "rules_block_ip_by_botcha" : {
"LABEL" : "Block IP by BOTCHA",
"PLUGIN" : "reaction rule",
"TAGS" : [ "BOTCHA" ],
"REQUIRES" : [ "rules", "php", "botcha" ],
"ON" : [ "botcha_form_rejected" ],
"IF" : [
{ "user_has_role" : {
"account" : [ "site:current-user" ],
"roles" : { "value" : { "1" : "1" } }
}
}
],
"DO" : [ { "php_eval" : { "code" : "system_block_ip_action();" } } ]
}
}
And in my logs there are many entries like this one:
RulesEvaluationException: Argument <em class="placeholder">total_recipes</em> is missing. in RulesPlugin->setUpState() (line 652 of /home/user/public_html/sites/all/modules/rules/includes/rules.core.inc).
Duplicate of: #1932406: RulesEvaluationException: Argument total_recipes is missing (BOTCHA)
Comments
Comment #1
iva2k CreditAttribution: iva2k commentedIn rules D7 there is a change in the API, rules_invoke_event_by_args() takes associative array and rules_invoke_event() takes positional arguments.
All 7.x- branches updated.
PLease verify that it fixes your issue and report back here.
Comment #3
lilou CreditAttribution: lilou commentedI have the same bug, but with the patched version, I got this message :
EntityMetadataWrapperException : Invalid data value given. Be sure it matches the required data type and format. dans EntityMetadataWrapper->set() (ligne 122 dans /home/xxxx/drupal/7.x/html/sites/all/modules/entity/includes/entity.wrapper.inc).
Comment #4
lilou CreditAttribution: lilou commentedComment #5
garymullins CreditAttribution: garymullins commentedI am experiencing the same issue.
I have tried both 7.x-3.2 and 7.x-3.x-dev with Drupal core 7.22
i'm tempted to try 7.x-4.x-dev.tar.gz but the release date is after the 7.x-3.x-dev release date and the date the bug was reported fixed (4/7).
I also think that the priority should be higher as it prevents user registration when both Rules and Botcha are active.
Comment #6
xbrianx CreditAttribution: xbrianx commentedI tried to do this exact same thing, but rules are not even firing on the botcha rejection as per my logs.