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

Deleted contacts are included in advanced search results when using Display As - Related Contacts option

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.6
    • Component/s: CiviCRM Search
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      To replicate:

      • Find an existing sample organization
      • Add > 1 'employer of' relationship for the organization
      • Now delete one of the employee records
      • Go to advanced search:
      • enter the org name in the top field (complete or partial name)
      • change Display Results As to "Related Contacts" > "Employee of"

      Results will include the deleted employee contact record.

      It looks like we need to add " AND contact_b.is_deleted " to the WHERE clause constructed by CRM_Contact_BAO_Query::filterRelatedContacts(). I took a shot at doing this but didn't quite get it right. Hopefully the fix is more obvious to you

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dgg David Greenberg
                Reporter:
                dgg David Greenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: