mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00

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.
37 lines
1.6 KiB
PHP
37 lines
1.6 KiB
PHP
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
//
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public Licensáe
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
/**
|
|
* MOODLE VERSION INFORMATION
|
|
*
|
|
* This file defines the current version of the core Moodle code being used.
|
|
* This is compared against the values stored in the database to determine
|
|
* whether upgrades should be performed (see lib/db/*.php)
|
|
*
|
|
* @package core
|
|
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
$version = 2020061506.05; // 20200615 = branching date YYYYMMDD - do not modify!
|
|
// RR = release increments - 00 in DEV branches.
|
|
// .XX = incremental changes.
|
|
$release = '3.9.6+ (Build: 20210420)'; // Human-friendly version name
|
|
$branch = '39'; // This version's branch.
|
|
$maturity = MATURITY_STABLE; // This version's maturity level.
|