MDL-57176 blocks: Never never never dup blocks

Dont create duplicate blocks 'requiredbytheme' for any reason.
This commit is contained in:
Damyon Wiese
2016-11-28 14:48:02 +08:00
parent 3eabedbb92
commit 58ec5a315b
+5
View File
@@ -1053,6 +1053,11 @@ class block_manager {
return;
}
// Never add a duplicate block required by theme.
if ($DB->record_exists('block_instances', array('blockname' => $blockname, 'requiredbytheme' => 1))) {
return;
}
$systemcontext = context_system::instance();
$defaultregion = $this->get_default_region();
// Add a special system wide block instance only for themes that require it.