-
Bug
-
Resolution: Fixed
-
Blocker
-
3.3
-
MOODLE_33_STABLE
-
MOODLE_33_STABLE
-
MDL-58736-master -
- Grep for usages of calendar_get_events and ensure there are none
- Ensure all unit tests pass
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).