Prior to this patch, if a user was in two groups, and an override
existed for both groups in an assignment the override
visually lower on the override list would be displayed on the
overview, whereas the one visually higher would be displayed
in the assignment grading table.
* Move and rename \core_calendar\local\api::get_legacy_events() to
calendar_get_legacy_events() in calendar/lib.php.
* Fix the parameter-normalising callback function in
calendar_get_legacy_events() so that it correctly handles false values
by returning an empty array instead of it returning a non-empty array
that contains an empty element.
The event test factory uses a closure to return only every other record.
This was previously working based on ID but MSSQL starts from an even
number rather than an odd number.
This change changes that to use a static variable which keeps a count of
the records instead and only returns every other record in this fashion,
removing the dependance upon ID.
This function was moved to local_api::get_legacy_events.
Also removed the calendar/classes/api.php file since it no longer contained any
functionality and added unit tests for local_api::get_legacy_events (a copy of
the unit tests for calendar_get_events).
Part of MDL-55611 epic.
Some unit tests needed to be updated to specify a few extra
bits and pieces on the events to work properly with the
new event vault behaviour.
Part of MDL-55611 epic.
The logic from get_events has now been moved in to our local API
and is used by the event vault to retrieve events, instead of
querying the database directly.
This has the advantage that it deals with overrides and only
returns events for the relevant user.
Part of MDL-55611 epic.
The event factory should simply instantiate an event for non action
events and pass only action events through the plumbing.
This way modules implementing the callbacks can be sure that what
is passed in to the callback is actually supposed to be an action event.
Part of MDL-55611 epic.
Initially we were only sending "top level" events through our API
i.e., events that can be repeated, but are not repeats themselves.
In the future we will be sending ALL events through our API and int
that situation the ID of the collection needs a small bit of logic
to correctly set the ID of the parent.
Part of MDL-55611 epic.
Modules associated with an event are stored in the event table
as the module's name and instance number not the actual ID of the instance
in the modules table.
So to lazy load them we need a proxy that uses the module name and instance
rather than the ID.
Part of MDL-55611 epic.