From ecdccb918ddd392e2dbd1cf46b6e89d773eb73a9 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 22 Sep 2016 12:32:42 +0800 Subject: [PATCH] MDL-55837 themes: Remove re-setting of user/site/course theme These themes cannot be chosen, so this part of the upgrade step is not necessary. --- lib/db/upgrade.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 469b6ab62ea..2dc080cf9f0 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2190,29 +2190,6 @@ function xmldb_main_upgrade($oldversion) { } if (!empty($themes)) { - - list($insql, $inparams) = $DB->get_in_or_equal($themes, SQL_PARAMS_NAMED); - - // Replace the theme usage. - $DB->set_field_select('course', 'theme', 'clean', "theme $insql", $inparams); - $DB->set_field_select('course_categories', 'theme', 'clean', "theme $insql", $inparams); - $DB->set_field_select('user', 'theme', 'clean', "theme $insql", $inparams); - $DB->set_field_select('mnet_host', 'theme', 'clean', "theme $insql", $inparams); - - // Replace the theme configs. - if (in_array(get_config('core', 'theme'), $themes)) { - set_config('theme', 'clean'); - } - if (in_array(get_config('core', 'thememobile'), $themes)) { - set_config('thememobile', 'clean'); - } - if (in_array(get_config('core', 'themelegacy'), $themes)) { - set_config('themelegacy', 'clean'); - } - if (in_array(get_config('core', 'themetablet'), $themes)) { - set_config('themetablet', 'clean'); - } - // Hacky emulation of plugin uninstallation. foreach ($themes as $theme) { unset_all_config_for_plugin('theme_' . $theme);