From 6e698a4563cad39f33140c4e074e83b6aece6bd9 Mon Sep 17 00:00:00 2001 From: Glenn Ansley Date: Fri, 7 Oct 2011 12:04:13 -0400 Subject: [PATCH] MDL-29697 Don't return the error if it wasn't updated because original question type had no answers --- mod/lesson/action/updatepage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/lesson/action/updatepage.php b/mod/lesson/action/updatepage.php index 2d46254e383..3545c3d21d6 100644 --- a/mod/lesson/action/updatepage.php +++ b/mod/lesson/action/updatepage.php @@ -71,7 +71,8 @@ } } } - if (!update_record("lesson_answers", $oldanswer)) { + // Don't return the error if it wasn't updated because original question type had no answers + if (!empty($oldanswer->id) && !update_record("lesson_answers", $oldanswer)) { error("Update page: EOB not updated"); } } else {