Commit a880d521 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Bug 1482384: Ingoring obsolete blocks when copying"

parents ed4a7bd3 61eb4706
......@@ -5434,12 +5434,14 @@ class View {
$this->set('columnsperrow', $template->get('columnsperrow'));
$blocks = get_records_array('block_instance', 'view', $template->get('id'));
$numcopied = array('blocks' => 0);
if ($blocks) {
foreach ($blocks as $b) {
safe_require('blocktype', $b->blocktype);
$oldblock = new BlockInstance($b->id, $b);
if ($oldblock->copy($this, $template, $artefactcopies)) {
$numcopied['blocks']++;
if (safe_require('blocktype', $b->blocktype, 'lib.php', 'require_once', true) !== false) {
$oldblock = new BlockInstance($b->id, $b);
if ($oldblock->copy($this, $template, $artefactcopies)) {
$numcopied['blocks']++;
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment