CRM-13133 Advanced Search is incorrectly including contacts removed from a group

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.7, 4.3.5
    • Fix Version/s: 4.4.2
    • Component/s: None
    • Labels:
      None

      Description

      I have reproduced this on the public sandbox at: http://drupal.demo.civicrm.org/

      To see the issue:
      1) Click "Search ... Advanced Search"

      2) Expand the "Relationship" section and choose relationship type of "Parent of" and also fill in "Target Contact(s) in Group" as the group "Kindergarden"

      3) Click the "search" button

      You will now see the results, which list the contact "Fairy Odd Parents". This is wrong, as their child "Timmy Turner" has been removed from the the group "Kindergarden"

      It seems like the field for "group status" ( inactive ) is being ignored by the advanced search.

        Attachments

          Activity

          [CRM-13133] Advanced Search is incorrectly including contacts removed from a group
          Eileen McNaughton added a comment -

          Fix is to add 'status' = 'added' to this join - est line 3852

          $this->_tables['civicrm_relationship_group_contact'] =
          $this->_whereTables['civicrm_relationship_group_contact'] =
          " LEFT JOIN civicrm_group_contact civicrm_relationship_group_contact ON civicrm_relationship_group_contact.contact_id = contact_b.id";
          $groupWhere[] = "( civicrm_relationship_group_contact.group_id IN (" . implode(",", $targetGroup[2]) . ") )";

            People

            • Assignee:
              Sarah Gladstone
              Reporter:
              Sarah Gladstone

              Dates

              • Created:
                Updated:
                Resolved: