From 685dee4b0e753c6c26668e23129b592b27b98f94 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Mon, 20 Nov 2023 11:02:13 +0800 Subject: [PATCH] MDL-79114 core: fix upgrade step remove basicoutcomes subplugin --- lib/db/upgrade.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 675fb0a129da8..62fe0e0880693 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3707,17 +3707,21 @@ function xmldb_main_upgrade($oldversion) { set_config('privatekey', null, 'mod_lti'); } + // Main savepoint reached. + upgrade_main_savepoint(true, 2023102000); + } + + if ($oldversion < 2023111600.00) { $servicetypes = ['basicoutcomes']; foreach ($servicetypes as $type) { - $versionFile = $CFG->dirroot . "mod/lti/service/{$type}/version.php"; - + $versionFile = $CFG->dirroot . "mod/lti/service/$type/version.php"; + if (!file_exists($versionFile)) { - // Clean config. - unset_all_config_for_plugin("ltiservice_$type"); + uninstall_plugin('ltiservice', 'basicoutcomes'); } } // Main savepoint reached. - upgrade_main_savepoint(true, 2023102000); + upgrade_main_savepoint(true, 2023111600.00); } return true;