Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-58736

Non backwards compatible change in calendar_get_events behaviour

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Calendar
    • Labels:

      Description

      In 3.3 we changed calendar_get_events such that it tries to respect user and group overrides and returns only the most applicable event.

      The details of this rely on the current logged in user, which is not good. Previously you could call it with something like: calendar_get_events(PHP_INT_MIN, PHP_INT_MAX, [3,4], true, true); and you would recieve all the events for users with id 3 and 4.

      Now it will only give you events for the current logged in user (in the case that the logged in user is neither 3 or 4 as in the example above, you will get back an empty array).

      A big part of the problem is that we attempt to solve the overrides problem with SQL, when really it should be done by filtering the results returned by the original query (probably).

        Attachments

          Activity

            People

            • Assignee:
              cameron1729 cameron1729
              Reporter:
              cameron1729 cameron1729
              Peer reviewer:
              Ryan Wyllie
              Integrator:
              Andrew Nicols
              Tester:
              Damyon Wiese
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17