I have 7 rules set up to help automate membership management. All are tagged with the same tag and all but one are active. WHen I search by tag or for all rules I get the correct result, but when I search by the tag AND all rules I get a DB query syntax fatal error. This is from the log:
[db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix=""
info="SELECT COUNT(DISTINCT(crr.id)) AS total FROM civirule_rule crr LEFT JOIN civirule_trigger crtrigger ON crr.trigger_id = crtrigger.id LEFT JOIN civirule_rule_tag crtag ON crr.id = crtag.rule_id LEFT JOIN civicrm_contact contact ON crr.created_user_id = contact.id WHERE AND (crtag.rule_tag_id = 1)
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (crtag.rule_tag_id = 1)' at line 5]"]
I suppose that some condition is expected between WHERE AND that I emphasized in bold. This same error happens on Civirules 1.23 and 2.1. The upgrade also updated the database, but I tested on a separate, older system that had not been upgraded.
Could this be due to some database corruption or is it a bug?