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

Smart group cache isn't rebuilt when a group is no longer a parent group

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.7
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      A trivial bug, and one I won't put resources into fixing, but not so trivial it's not worth reporting.

      To replicate:

      • Create two groups with at least one distinct contact in each and make one the child of another.
      • Rebuild your smart group cache. civicrm_group_contact_cache now stores a record for the contacts in the child group so they come up for searches of the parent group.
      • Remove the parent/child relationship between the groups.
      • NOTE: I'm pretty sure the bug only manifests if the parent group is no longer a parent to ANY other groups.

      Expected result:
      The child group's contacts are no longer found when searching the parent group.

      Actual result:
      The child group's contacts show up in searches on the parent group.

      It appears that when rebuilding the smart group cache, non-smart non-parent groups are excluded. Which makes sense but excludes the possibility that a group was once a parent group. I think the ideal solution is that when clearing the smart group cache, remove any records where the parent_group_id is neither a parent not smart group. But you could also do this check when removing a parent/child group connection, or even at search time.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              palantejon Jon K Goldberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: