* Use the calendar_event::description property and format it using
format_text() on it in order to apply the appropriate filters.
* Then use html_to_text() on it to strip the tags and convert the
description to plain text while converting <br> and <p> tags to
line breaks.
There are situations where we need to sort events on a field called
"timesort", but sometimes it is not set. So we can fall back to
"timestart" in this case.
* Change the start date of the parent event to the current date
for tests that with events that recur forever.
* Limit query results to 100 for events that recur forever that can
generate more than 100 event records.
We modified calendar_get_events in a non backwards compatible way
so instead of fixing that, an easier approch is to simply revert
it to the 3.2 implementation. This should be fine since the way
to get events is going to change in an upcomming release, and we
had to swap all occurences of calendar_get_events in core with
calendar_get_legacy_events to make sure the calendar and overview match.
Previously we were not filtering on groups in the event vault
which meant events for all groups would be returned regardless
of which user was passed in.
This resulted in situations where one student would group overrides
for groups they were not in.
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.