Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f89a83b
)
MDL-30655 Blocks: Moving block to top of list can cause (harmless) PHP warnings
author
sam marshall
<s.marshall@open.ac.uk>
Thu, 8 Dec 2011 12:36:55 +0000
(12:36 +0000)
committer
sam marshall
<s.marshall@open.ac.uk>
Fri, 9 Dec 2011 17:45:23 +0000
(17:45 +0000)
lib/blocklib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/blocklib.php
b/lib/blocklib.php
index
d5d1c3b
..
508b94c
100644
(file)
--- a/
lib/blocklib.php
+++ b/
lib/blocklib.php
@@
-1467,8
+1467,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);