Skip to content

Commit

Permalink
Merge branch '43714-25' of git://github.com/samhemelryk/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_25_STABLE
  • Loading branch information
danpoltawski committed Jan 21, 2014
2 parents 9102d4e + 70c4647 commit 4bdaa6a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/ajax/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,14 @@

$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;
Expand Down

0 comments on commit 4bdaa6a

Please sign in to comment.