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

Fix ACL caching function to not use inefficient query for contacts with 'view my contact' permission in cache context

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.12
    • Fix Version/s: 4.7.14
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      The 'View My Contact' permission results in a horrifically inefficient query for contacts who also have ACL access as it appends this permission as an 'OR'. We can partially fix this without too much work by altering the CRM_Contact_BAO_Contact_Permission::cache function to request the $whereClause without this clause added and to manage the caching of it itself. This still leaves us stuck when the cache is bypassed but it addresses a serious performance gotcha affecting some sites

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: