Skip to content

Commit

Permalink
Merge branch 'w49_MDL-30517_m22_blockdelete' of git://github.com/skod…
Browse files Browse the repository at this point in the history
…ak/moodle
  • Loading branch information
Aparup Banerjee committed Nov 30, 2011
2 parents e801280 + 8620bfe commit e95a0ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit e95a0ce

Please sign in to comment.