MDL-82034 mod_subsection: Enable mod_subsection when upgrading

This commit is contained in:
Amaia Anabitarte
2024-12-20 10:31:22 +01:00
parent 4dda4b9dd9
commit 4c2b9922df
3 changed files with 22 additions and 1 deletions
+9
View File
@@ -899,6 +899,15 @@ $CFG->admin = 'admin';
// Force result of checks used to determine whether a site is considered "public" or not (such as for site registration).
// $CFG->site_is_public = false;
//
// The mod_subsection feature has been added in 4.5 but is disabled by default. For new 5.0 sites, however, it will be enabled
// by default. When upgrading from an earlier version to 5.0 or later, mod_subsection will also be enabled unless the
// 'keepsubsectiondisabled' setting is set to true. In that case, the status of mod_subsection will remain unchanged during the
// upgrade process.
// This setting applies only to upgrades from version 4.5 where subsections already exist. It does not affect other upgrades or
// new installations.
// Note that the 'keepsubsectiondisabled' setting will be removed in version 6.0. (MDL-83791)
// $CFG->keepsubsectiondisabled = false;
//
//=========================================================================
// 8. FORCED SETTINGS
//=========================================================================
+12
View File
@@ -1341,5 +1341,17 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2024121800.00);
}
if ($oldversion < 2024121900.01) {
// Enable mod_subsection unless 'keepsubsectiondisabled' is set.
if ((empty($CFG->keepsubsectiondisabled) || !$CFG->keepsubsectiondisabled)
&& $DB->get_record('modules', ['name' => 'subsection'])) {
$manager = \core_plugin_manager::resolve_plugininfo_class('mod');
$manager::enable_plugin('subsection', 1);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2024121900.01);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2024121900.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2024121900.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '5.0dev (Build: 20241219)'; // Human-friendly version name