diff --git a/classes/template.php b/classes/template.php index e0add1a..a85107f 100644 --- a/classes/template.php +++ b/classes/template.php @@ -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)); }