Fixed moving item issue
If an item to swap was not found (so was equal to false) the function was still handling this as true as it was using 'isset', rather than '!empty'.
This commit is contained in:
parent
362cc5f092
commit
05e83ee638
1 changed files with 1 additions and 1 deletions
|
@ -327,7 +327,7 @@ class template {
|
|||
}
|
||||
|
||||
// Check that there is an item to move, and an item to swap it with.
|
||||
if ($moveitem && isset($swapitem)) {
|
||||
if ($moveitem && !empty($swapitem)) {
|
||||
$DB->set_field($table, 'sequence', $swapitem->sequence, array('id' => $moveitem->id));
|
||||
$DB->set_field($table, 'sequence', $moveitem->sequence, array('id' => $swapitem->id));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue