Fixed sequence values when deleting an element

This commit is contained in:
Mark Nelson 2015-03-13 20:53:11 -07:00
parent 53cb267836
commit e85807e298
2 changed files with 29 additions and 6 deletions

View file

@ -118,12 +118,7 @@ if ((!empty($moveup)) || (!empty($movedown))) {
}
} else if (!empty($deleteelement)) { // Check if we are deleting an element.
if (!empty($confirm)) { // Check they have confirmed the deletion.
// Ensure element exists and delete it.
$element = $DB->get_record('customcert_elements', array('id' => $deleteelement), '*', MUST_EXIST);
// Get an instance of the element class.
if ($e = customcert_get_element_instance($element)) {
$e->delete_element();
}
customcert_delete_element($deleteelement);
} else {
// Set deletion flag to true.
$deleting = true;