MDL-56902 blocks: no nav / settings in boost

Upgraded sites switching to boost should not see nav/settings blocks.
This commit is contained in:
Damyon Wiese
2016-11-22 15:02:51 +08:00
parent 51718b752d
commit 45ed4271b7
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -2420,6 +2420,18 @@ function xmldb_main_upgrade($oldversion) {
// Main savepoint reached.
upgrade_main_savepoint(true, 2016111900.00);
}
if ($oldversion < 2016111900.02) {
// Change the existing site level admin and settings blocks to be requiredbytheme which means they won't show in boost.
$context = context_system::instance();
$params = array('blockname' => 'settings', 'parentcontextid' => $context->id);
$DB->set_field('block_instances', 'requiredbytheme', 1, $params);
$params = array('blockname' => 'navigation', 'parentcontextid' => $context->id);
$DB->set_field('block_instances', 'requiredbytheme', 1, $params);
// Main savepoint reached.
upgrade_main_savepoint(true, 2016111900.02);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2016111900.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2016111900.02; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.