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

CRM_Event_BAO_Event::checkPermission($dao->id) only works with the first ID when called repeatedly.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.30
    • Fix Version/s: None
    • Component/s: CiviEvent
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      If CRM_Event_BAO_Event::checkPermission($dao->id) is called repeatedly, i.e. looking at several events, it only returns a permission on the first event.  This seems to be because when first called, it gets the first event's permissions and then remembers them in subsequent calls. Instead, it should be getting the permissions on all events and remembering them, shouldn't it?

      Removing lines 2077 to 2080 ensures that it doesn't just get permission for the first event queried, but all relevant events. 

       

      I plan to generate a PR for this.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              spalmstr Stephen Palmstrom
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: