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:
mudrd8mz
2008-10-09 11:04:12 +00:00
parent 8b21237fd4
commit 09c2eb69e2
+3 -1
View File
@@ -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");