MDL-57437 core: upgrade code for introduction of block_myoverview

Part of MDL-55611 epic.
This commit is contained in:
Mark Nelson 2016-12-20 16:42:43 +08:00 committed by Damyon Wiese
parent 1c69e1994d
commit 932f299bc0
3 changed files with 12 additions and 2 deletions

View File

@ -2537,6 +2537,6 @@ function blocks_add_default_system_blocks() {
}
$newblocks = array('private_files', 'online_users', 'badges', 'calendar_month', 'calendar_upcoming');
$newcontent = array('lp', 'course_overview');
$newcontent = array('lp', 'myoverview');
$page->blocks->add_blocks(array(BLOCK_POS_RIGHT => $newblocks, 'content' => $newcontent), 'my-index', $subpagepattern);
}

View File

@ -2611,5 +2611,15 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2017031400.00);
}
if ($oldversion < 2017040300.04) {
// If the 'Course overview' block is no longer present, replace with the 'My overview' block.
if (!file_exists($CFG->dirroot . '/blocks/course_overview/block_course_overview.php')) {
$DB->set_field('block_instances', 'blockname', 'myoverview', array('blockname' => 'course_overview'));
}
upgrade_main_savepoint(true, 2017040300.04);
}
return true;
}

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2017033100.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2017040300.04; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.