Commit c02c709d authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Fix bugs when changing view layout. Bug 1432641"

parents 77c6614e 748538e3
......@@ -2523,14 +2523,10 @@ class View {
if ($currentcol > $prevrownumcolumns) {
$currentcol = 1;
}
if ($currentcol == $values['column']) {
// don't redistrubute blocks here!
}
if (!array_key_exists($currentcol, $prevrowcolumnmax)) {
$prevrowcolumnmax[$currentcol] = $this->get_current_max_order($values['row']-1, $currentcol);
}
$this->shuffle_cell($values['row']-1, $currentcol, $prevrowcolumnmax[$currentcol]+1);
$this->shuffle_cell($values['row'], $currentcol, null, $block->get('order'));
$block->set('row', $values['row']-1);
$block->set('column', $currentcol);
$block->set('order', $prevrowcolumnmax[$currentcol]+1);
......@@ -2724,7 +2720,7 @@ class View {
$extravalues = array();
}
// first move them one but switch to negtaive
// first move them one but switch to negative
$sql = 'UPDATE {block_instance}
SET "' . $field .'" = (-1 * ("' . $field . '") ' . (($direction == 'up') ? '-' : '+') . ' 1)
WHERE "view" = ? AND "' . $field . '"' . $operator . ' ? ' . $extrawhere;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment