mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-16506 Fixed error when deleting the only page in the Lesson. Credit goes to Chris Bertagne for the patch. Merged from 1.9
This commit is contained in:
parent
38dc85bf1f
commit
a51a5ee009
@ -21,7 +21,9 @@
|
||||
$DB->delete_records("lesson_pages", array("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 = $DB->get_record("lesson_pages", array("id" => $thispage->nextpageid))) {
|
||||
print_error("Delete: next page not found");
|
||||
|
Loading…
x
Reference in New Issue
Block a user