moodle/calendar
Simey Lameze 94259f8a7d MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:43:37 +08:00
..
amd MDL-69135 core_calendar: PendingJS for event filtering 2020-06-26 07:58:36 +08:00
classes MDL-71182 calendar: add logic for category events in get_context 2021-03-24 17:34:31 +08:00
templates MDL-70625 core_calendar: Fix whitespace appearance in the id attribute 2021-01-14 01:59:08 +11:00
tests MDL-71156 core: machinery to recover orphaned calendar events 2021-04-22 10:43:37 +08:00
type/gregorian MDL-70089 versions: bump all versions and requires near release 2020-11-03 19:34:52 +01:00
delete.php MDL-59671 core_calendar: replace current delete permission checks 2017-08-09 14:51:22 +08:00
event.php MDL-59890 calendar: Display category events on calendars 2017-10-03 23:22:18 +08:00
event_form.php Merge branch 'MDL-58997-group-names-multilang' of https://github.com/lucaboesch/moodle 2017-05-30 16:53:06 +01:00
export.php MDL-68845 calendar: Move duplicated code to function 2020-09-29 10:54:05 +02:00
export_execute.php MDL-69910 calendar: Fix export exception when both params are sent 2020-10-10 19:28:45 +11:00
externallib.php MDL-68098 ws: Fix WebServices broken by filters HTML 2020-09-23 12:08:40 +02:00
index.php MDL-21233 moodle_url improvemewnts, code simplification, more diagnostics; fixed several regressions 2010-01-16 15:39:56 +00:00
lib.php MDL-71182 calendar: Revert "Merge branch 'MDL-67494-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE" 2021-03-24 09:22:04 +08:00
managesubscriptions.php MDL-66455 calendar: show site level subscriptions 2019-10-31 18:44:14 +08:00
renderer.php MDL-58866 core_calendar: allow component events 2020-05-19 19:04:13 +02:00
upgrade.txt MDL-69479 upgrade: Change all 4.0 occurrences to 3.10 2020-08-24 14:08:46 +08:00
view.php MDL-66875 calendar: allow the use of day, mon and year again. 2020-01-25 00:56:39 +01:00