Skip to content
Browse files

lib/blocklib.php MDL-21805 Moving blocks up/down causes blocks to dis…

…appear

If two blocks of the same type were next to each other the weight would be
set the same and block disappear..

Thanks to my colleague Andrew Nicols for the patch.

(This patch was commited on a train at 90mph near Coventry, UK)
  • Loading branch information...
1 parent 7b6c6e9 commit 3afe38a532043d227828de9ef0df1e79a5c33a81 @danpoltawski danpoltawski committed Mar 11, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/blocklib.php
View
4 lib/blocklib.php
@@ -580,7 +580,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid,
if (!empty($pageblocks[$instance->position][$instance->weight - 1])) {
//define instance's position in the array
foreach ($pageblocks[$instance->position] as $instancekeysindex => $index ){
- if ($pageblocks[$instance->position][$instancekeysindex]->blockid == $instance->blockid){
+ if ($pageblocks[$instance->position][$instancekeysindex]->id == $instance->id){
$instanceindex = $instancekeysindex;
}
}
@@ -622,7 +622,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid,
if (!empty($pageblocks[$instance->position][$instance->weight + 1])) {
//define instance's position in the array
foreach ($pageblocks[$instance->position] as $instancekeysindex => $index ){
- if ($pageblocks[$instance->position][$instancekeysindex]->blockid == $instance->blockid){
+ if ($pageblocks[$instance->position][$instancekeysindex]->id == $instance->id){
$instanceindex = $instancekeysindex;
}
}

0 comments on commit 3afe38a

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