diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index f209c40f769..6b6573ce300 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -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)); }