Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-12725

Query builder weird behavior with boolean custom fields

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.3.3
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)

      Description

      Related to CRM-12712.

      I am using the query builder with different filters on boolean fields and several things are not right.
      In this case I am filtering by membership since, and by the boolean custom field "Member". I assume the bugs appear even if I was to search without the membership filter.
      Search 1a:
      Member Since > 20130217 ...AND... Member = No
      => 284 Contacts
      Search 1b:
      Member Since > 20130217 ...AND... Member = Yes
      => 190 Contacts
      Search 2a:
      Member Since > 20130217 ...AND... Member != Yes
      => 284 Contacts
      Search 3:
      Member Since > 20130217 ...AND... Member IS NULL
      => 26 Contacts
      -> Note: These 26 contacts were not included in the 284 above!
      Search 4:
      Member Since > 20130217 ...AND... Member IS NOT NULL
      => 474 Contacts
      Search 5:
      Member Since > 20130217 ...AND... Member IS EMPTY
      => 310 Contacts
      Search 6:
      Member Since > 20130217 ...AND... Member IS NOT EMPTY
      => 190 Contacts

      Issues:
      1. Search 1a lists the same results as 2a, but 1a should actually also include the 26 contacts from Search 3 which have NULL values.
      2. Search 5 (IS EMPTY) seems to apply no filter whatsoever – it catches Yes, No, and NULL
      3. Search 6 (IS NOT EMPTY) seems to do the same as filtering by Yes.
      4. After using the query builder with = Yes or =No on a query field, and the refining the criteria to IS (NOT) NULL, IS (NOT) EMPTY, the Yes/No operator is still shown in the list of criteria. So after searching for Member = Yes and then going to Member IS NULL, the UI will show "Member IS NULL Yes"

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rares Rares P
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: