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

Scheduled reminders silently skipped for contacts with a non-permissioned relationship associated with ANY inherited membership type

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.3
    • Fix Version/s: 5.8
    • Component/s: None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      This bug affects a specific edge case where contact A has:

      • 2 inherited memberships with different 'owner' contacts (B and C)
      • Contact A has permissioned relationship with B but NOT with C
      • Both memberships have properties such that a reminder is triggered for both in the same execution of Send Scheduled Reminders job

      The current code structure uses a global {$notInClause} for the job which excludes non-permissioned inherited membership contacts from getting a reminder. This would need to be changed so that we have separate excluded 'slave contact' lists for each owner_membership instance.

      — Original description —
      I'm not sure if this is my blocker so will hold this & flesh it out as I figure it out but it seems the code for adding a permissionedRelationships where clause removes contacts from the scheduled reminder based on them having a non-permissioned relationship for ANY inherited membership - which means they can't get a reminder for a different (unrelated) relationship either.

      static function permissionedRelationships($field) {
      $query = '
      SELECT cm.id AS owner_id, cm.contact_id AS owner_contact, m.id AS slave_id, m.contact_id AS slave_contact, cmt.relationship_type_id AS relation_type, rel.contact_id_a, rel.contact_id_b, rel.is_permission_a_b, rel.is_permission_b_a
      FROM civicrm_membership m
      LEFT JOIN civicrm_membership cm ON cm.id = m.owner_membership_id
      LEFT JOIN civicrm_membership_type cmt ON cmt.id = m.membership_type_id
      LEFT JOIN civicrm_relationship rel ON ( ( rel.contact_id_a = m.contact_id AND rel.contact_id_b = cm.contact_id AND rel.relationship_type_id = cmt.relationship_type_id )
      OR ( rel.contact_id_a = cm.contact_id AND rel.contact_id_b = m.contact_id AND rel.relationship_type_id = cmt.relationship_type_id ) )
      WHERE m.owner_membership_id IS NOT NULL AND
      ( rel.is_permission_a_b = 0 OR rel.is_permission_b_a = 0)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andrewhunt Andrew Hunt
                Reporter:
                eileen Eileen McNaughton
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: