Merge branch 'w49_MDL-30517_m22_blockdelete' of git://github.com/skodak/moodle
authorAparup Banerjee <aparup@moodle.com>
Wed, 30 Nov 2011 09:39:23 +0000 (17:39 +0800)
committerAparup Banerjee <aparup@moodle.com>
Wed, 30 Nov 2011 09:39:23 +0000 (17:39 +0800)
lib/db/upgrade.php

index f209c40..6b6573c 100644 (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));
             }