I’m using Drupal 7.56, the Rules module 7.x-2.11, and CiviCRM 4.6.31.
I've been using the Text comparison and Data comparison conditions.
Using the Text comparison condition, the condition is always met, so the action is always executed, despite the value of the data.
Why does this condition always evaluate to TRUE
, for all the possible values, even when the text of the data is different to the matching text?
This is the log entry.
The condition text_matches evaluated to TRUE.
This is the export of the rule.
{ "rules_create_a_drupal_account_for_a_civicrm_contact" : {
"LABEL" : "Create a Drupal account for a CiviCRM contact",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "civicrm", "rules", "devel" ],
"ON" : { "civicrm_membership_create" : [] },
"IF" : [
{ "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm-membership:contact-id-contact" ] } },
{ "AND" : [
{ "NOT data_is_empty" : { "data" : [ "civicrm-membership:contact-id-contact:contact-sub-type" ] } },
{ "AND" : [
{ "text_matches" : {
"text" : [ "civicrm-membership:contact-id-contact:contact-sub-type" ],
"match" : "Parent"
}
}
]
}
]
}
],
"DO" : [
{ "devel_debug" : { "value" : [ "civicrm-membership:contact-id-contact:contact-sub-type" ] } },
{ "civicrm_entity_action_create_user" : {
"USING" : {
"civicrm_contact" : [ "civicrm-membership:contact-id-contact" ],
"is_active" : "1",
"notify" : "0",
"signin" : "0",
"username_format" : "email"
},
"PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created Drupal User" } }
}
},
{ "user_add_role" : { "account" : [ "civicrm-user" ], "roles" : { "value" : { "5" : "5" } } } }
]
}
}
Using the Data comparison condition, the condition is never met and the action is never executed, despite the data to compare.
Why does this condition always evaluate to FALSE
, for all the data, even when it is the same to the value to compare?
This is the log entry.
The condition data_is evaluated to FALSE.
This is the export of the rule.
{ "rules_create_a_drupal_user_account2" : {
"LABEL" : "Create a Drupal User Account2",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "civicrm", "rules" ],
"ON" : { "civicrm_membership_create" : [] },
"IF" : [
{ "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm-membership:contact-id-contact" ] } },
{ "AND" : [] },
{ "data_is" : {
"data" : [ "civicrm-membership:contact-id-contact:contact-sub-type" ],
"value" : "Parent"
}
}
],
"DO" : [
{ "civicrm_entity_action_create_user" : {
"USING" : {
"civicrm_contact" : [ "civicrm-membership:contact-id-contact" ],
"is_active" : "1",
"notify" : "0",
"signin" : "0",
"username_format" : "email"
},
"PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created Drupal User" } }
}
}
]
}
}
Any clue about what might be happening?