MDL-76033 core: bump version in is_major_upgrade_required

MDL-58266 changes db structure. So upgrade must happen before
accessing any page.
This commit is contained in:
Ilya Tregubov 2022-10-19 12:56:02 +03:00
parent f8d28e4ca6
commit 3f568024a1
3 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,8 @@
require_once('lib.php');
require_once($CFG->libdir.'/completionlib.php');
redirect_if_major_upgrade_required();
$id = optional_param('id', 0, PARAM_INT);
$name = optional_param('name', '', PARAM_TEXT);
$edit = optional_param('edit', -1, PARAM_BOOL);

View File

@ -1411,7 +1411,7 @@ function disable_output_buffering() {
*/
function is_major_upgrade_required() {
global $CFG;
$lastmajordbchanges = 2022022200.00;
$lastmajordbchanges = 2022101400.03; // This should be the version where the breaking changes happen.
$required = empty($CFG->version);
$required = $required || (float)$CFG->version < $lastmajordbchanges;

View File

@ -40,6 +40,8 @@ require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/my/lib.php');
require_once($CFG->libdir.'/adminlib.php');
redirect_if_major_upgrade_required();
$resetall = optional_param('resetall', false, PARAM_BOOL);
$pagetitle = get_string('mypage', 'admin');