Browse files

MDL-30655 Blocks: Moving block to top of list can cause (harmless) PH…

…P warnings
  • Loading branch information...
1 parent f89a83b commit 7728860ae5af5e0f9b72061309888ac26dc91e14 @sammarshallou sammarshallou committed Dec 8, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/blocklib.php
View
6 lib/blocklib.php
@@ -1467,8 +1467,10 @@ public function process_url_move() {
} else {
$newweight = ceil($newweight);
for ($weight = $bestgap - 1; $weight >= $newweight; $weight--) {
- foreach ($usedweights[$weight] as $biid) {
- $this->reposition_block($biid, $newregion, $weight + 1);
+ if (array_key_exists($weight, $usedweights)) {
+ foreach ($usedweights[$weight] as $biid) {
+ $this->reposition_block($biid, $newregion, $weight + 1);
+ }
}
}
$this->reposition_block($block->instance->id, $newregion, $newweight);

0 comments on commit 7728860

Please sign in to comment.