Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'w49_MDL-30517_m22_blockdelete' of git://github.com/skod…

…ak/moodle
  • Loading branch information...
commit e95a0cefda93f05967c11d8217e403450e179be7 2 parents e801280 + 8620bfe
@nebgor nebgor authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/db/upgrade.php
View
3  lib/db/upgrade.php
@@ -6819,7 +6819,8 @@ function xmldb_main_upgrade($oldversion) {
if ($dbman->table_exists($table)) {
$instances = $DB->get_records('block_instances', array('blockname'=>'search'));
foreach($instances as $instance) {
- context_helper::delete_instance(CONTEXT_BLOCK, $instance->id);
+ $context = context_block::instance($instance->id);
+ upgrade_cleanup_unwanted_block_contexts(array($context->id)); // do not use standard block deleting MDL-30517, there is no extra stuff used in block, so this should be safe
$DB->delete_records('block_positions', array('blockinstanceid' => $instance->id));
$DB->delete_records('block_instances', array('id' => $instance->id));
}
Please sign in to comment.
Something went wrong with that request. Please try again.