Merge branch 'w49_MDL-30517_m22_blockdelete' of git://github.com/skodak/moodle

This commit is contained in:
Aparup Banerjee
2011-11-30 17:39:23 +08:00
+2 -1
View File
@@ -6819,7 +6819,8 @@ FROM
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));
}