Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix for bug 3510:

Due to stupidly copy/pasting some code, deleting a block instance could,
under some circumstances, throw a fatal error.
  • Loading branch information...
commit 9b8a8597818508f9e638b4ae458f35b2b9a251d2 1 parent d031cf0
defacer authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 lib/blocklib.php
5 lib/blocklib.php
@@ -185,10 +185,10 @@ function blocks_delete_instance($instance) {
185 185
186 186 // Get the block object and call instance_delete() first
187 187 if(!$record = blocks_get_record($instance->blockid)) {
188   - continue;
  188 + return false;
189 189 }
190 190 if(!$obj = block_instance($record->name, $instance)) {
191   - continue;
  191 + return false;
192 192 }
193 193
194 194 // Return value ignored
@@ -200,6 +200,7 @@ function blocks_delete_instance($instance) {
200 200 execute_sql('UPDATE '.$CFG->prefix.'block_instance SET weight = weight - 1 WHERE pagetype = \''.$instance->pagetype.
201 201 '\' AND pageid = '.$instance->pageid.' AND position = \''.$instance->position.
202 202 '\' AND weight > '.$instance->weight, false);
  203 + return true;
203 204 }
204 205
205 206 // Accepts an array of block instances and checks to see if any of them have content to display

0 comments on commit 9b8a859

Please sign in to comment.
Something went wrong with that request. Please try again.