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:
Mark Nelson 2016-02-20 18:39:12 +08:00
parent 362cc5f092
commit 05e83ee638

View file

@ -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));
}