moodle/admin
Simey Lameze c72839d6d0 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:45:27 +08:00
..
classes MDL-67650 admin: Consistently show forced config settings 2020-10-22 13:17:17 +11:00
cli MDL-71156 core: machinery to recover orphaned calendar events 2021-04-22 10:45:27 +08:00
mnet MDL-66999 theme_boost: @extend replace .alert 2019-12-09 10:49:39 +01:00
registration MDL-68060 registration: Improve the sites directory location check 2020-02-26 10:59:15 +01:00
roles Merge branch 'MDL-64764' of git://github.com/paulholden/moodle 2020-01-08 08:30:02 +08:00
settings MDL-66392 analytics: make model output directory default to empty. 2020-10-21 17:32:29 +01:00
templates MDL-67650 admin: Consistently show forced config settings 2020-10-22 13:17:17 +11:00
tests/behat MDL-69788 admin: validate language menu configuration. 2020-10-21 11:24:18 +01:00
tool Merge branch 'MDL-60490-missing_close_div-39' of https://github.com/leonstr/moodle into MOODLE_39_STABLE 2021-04-16 11:55:01 +08:00
user MDL-68500 dataformat: re-factor download/export methods into new class. 2020-05-04 16:01:12 +01:00
webservice MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
admin_settings_search_form.php
antiviruses.php MDL-67362 antivirus: Add enabling and order changes to config_log 2019-11-26 14:35:00 +11:00
auth.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
auth_config.php
blocks.php
category.php MDL-67523 core_admin: do not require admin to view category 2019-12-19 10:13:38 +01:00
contentbank.php MDL-67786 core_contentbank: New content bank contenttype plugin type 2020-04-15 23:45:08 +02:00
courseformats.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
cron.php
customfields.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
dataformats.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
editors.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
enrol.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
environment.php
environment.xml MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 2021-02-26 13:08:11 +01:00
filters.php
index.php MDL-68558 admin: Allow to go back to plugins check page on failed deps 2020-07-23 17:02:31 +02:00
lib.php
localplugins.php
lock.php MDL-53566 core: Add UI for context locking 2018-11-13 21:17:40 +08:00
mailout-debugger.php
media.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
message.php MDL-68339 message: move array_key_exists() to property_exists() 2020-04-16 20:28:22 +02:00
modules.php MDL-68292 core: Remove sesskey leakage on module pages 2020-10-12 17:11:48 +11:00
oauth2callback.php
phpinfo.php
plagiarism.php
plugins.php MDL-68292 core: Remove sesskey leakage on module pages 2020-10-12 17:11:48 +11:00
portfolio.php
process_email.php
purgecaches.php
qbehaviours.php MDL-66999 theme_boost: @extend text-muted 2019-12-09 10:49:39 +01:00
qtypes.php MDL-66999 theme_boost: @extend text-muted 2019-12-09 10:49:39 +01:00
renderer.php MDL-68558 admin: Allow to go back to plugins check page on failed deps 2020-07-23 17:02:31 +02:00
reports.php
repository.php MDL-66968 php74: array_key_exists() for objects is deprecated 2019-10-25 00:49:04 +02:00
repositoryinstance.php
resetemoticons.php
search.php
searchareas.php MDL-60913 search: add search area categories 2019-01-23 10:28:43 +11:00
searchreindex.php
settings.php MDL-52167 admin: now able to show/hide settings based on conditions 2019-02-26 15:45:35 +01:00
tasklogs.php MDL-70567 task: fix broken result filter on logs page 2021-01-06 14:28:38 +11:00
testoutgoingmailconf.php MDL-68279 admin: filter site fullname when sending test email. 2020-04-06 11:41:18 +01:00
thirdpartylibs.php
timezone.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
tools.php
updatesetting.php MDL-58439 admin: Ignore guest logins for all admin pages 2019-06-11 13:44:58 +10:00
upgrade.txt MDL-65809 upgrade: remove upgrade_block_positions 2019-12-20 12:20:43 +01:00
upgradesettings.php
user.php MDL-66999 theme_boost: @extend remove extends for tables 2019-12-12 11:27:56 +01:00