Skip to content

CiviRules, field value comparison will fail when checking a value of '0' in custom field

CiviRules, field value comparison will fail when checking a value of '0' in custom field. This problem can be replicated by either of the following examples:

  1. Creating a custom field of Data Type Yes or No which uses values Yes = 1 and No = 0. Create a CiviRule trigger which uses the field value comparison to check for the 'No' value which is stored as '0'. The CiviRule will not be triggered.
  2. Creating a custom field of Data Type Alphanumeric with Field Type, Radio, set options Yes = 1 and No = 0. Create a CiviRule trigger which uses the field value comparison to check for the 'No' value which is stored as '0'. The CiviRule will not be triggered.

Not sure why the code was explicitly checking for an empty value, which unfortunately also matches a '0' value. Therefore a suggested change and should be reviewed.

Agileware Ref: CIVIRULES-11

Edited by justinfreeman (Agileware)

Merge request reports