MDL-16506 Fixed error when deleting the only page in the Lesson. Credit goes to Chris Bertagne for the patch.
This commit is contained in:
@@ -21,7 +21,9 @@
|
||||
delete_records("lesson_pages", "id", $pageid);
|
||||
|
||||
// repair the hole in the linkage
|
||||
if (!$thispage->prevpageid) {
|
||||
if (!$thispage->prevpageid AND !$thispage->nextpageid) {
|
||||
//This is the only page, no repair needed
|
||||
} elseif (!$thispage->prevpageid) {
|
||||
// this is the first page...
|
||||
if (!$page = get_record("lesson_pages", "id", $thispage->nextpageid)) {
|
||||
error("Delete: next page not found");
|
||||
|
||||
Reference in New Issue
Block a user