MDL-49389 blocklib: avoid notices when moving blocks to the bottom

This commit is contained in:
Tim Hunt 2015-03-04 18:47:59 +00:00
parent 06122e46fd
commit e1ace26f11

View file

@ -1599,8 +1599,10 @@ class block_manager {
if ($bestgap < $newweight) {
$newweight = floor($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);