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

This commit is contained in:
sam marshall
2011-12-13 13:29:17 +08:00
committed by Aparup Banerjee
parent cc8f03e067
commit 78e5c3600d
+4 -2
View File
@@ -1457,8 +1457,10 @@ class block_manager {
} 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);