CRM-14020 Advanced Search not using proper operator with multipule groups

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 4.4.3
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      On the demo site I created a test group with 2 contacts in the group. One of the contacts was also in a group on the demo site called Government entity sg

      I went to the advanced search and did a search with those 2 groups listed. The search operator was and. The expected result i would have thought is it returns any contacts that are in both groups i.e. 1. However returned a search where the operator would have been or i.e. it looked for contacts that were in either group

      Seamus

        Attachments

          Activity

          [CRM-14020] Advanced Search not using proper operator with multipule groups
          Donald A. Lobo added a comment -

          Please discuss on forums. The AND operator is across various fields. Within a group its always OR. Maybe making the docs more clear might be a good next step

          Erik Hommel added a comment -

          Investigating this in 4.3.7: in the Contact_Selector class, the where clause is not built correctly. The SQL operator used is '!=' and the cache group is not correct when I try to get members of group 9 and not in group 1:

          [_whereClause] => ( ( ( ( `civicrm_group_contact-9`.group_id = ( 9 ) AND `civicrm_group_contact-9`.status IN ("Added") ) OR ( `civicrm_group_contact_cache_9`.group_id = 9 ) ) AND ( ( `civicrm_group_contact-1`.group_id != ( 1 ) AND `civicrm_group_contact-1`.status IN ("Added") ) OR ( `civicrm_group_contact_cache_1`.group_id = 1 ) ) ) )

            People

            • Assignee:
              Unassigned
              Reporter:
              Seamus Lee

              Dates

              • Created:
                Updated:
                Resolved: