Merge branch '43714-26' of git://github.com/samhemelryk/moodle into MOODLE_26_STABLE

This commit is contained in:
Dan Poltawski
2014-01-21 14:49:27 +08:00
+8 -3
View File
@@ -88,9 +88,14 @@ switch ($action) {
$bui_newweight = null;
if ($bui_beforeid == 0) {
// Moving to very bottom
$last = end($instances);
$bui_newweight = $last->instance->weight + 1;
if (count($instances) === 0) {
// Moving the block into an empty region. Give it the default weight.
$bui_newweight = 0;
} else {
// Moving to very bottom.
$last = end($instances);
$bui_newweight = $last->instance->weight + 1;
}
} else {
// Moving somewhere
$lastweight = 0;