From 21d6123fbd0305b01951461e6664a53634df7c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Santos?= Date: Wed, 21 Aug 2019 09:48:28 +0200 Subject: [PATCH] MDL-66409 mod_lesson: Fix editing of numerical pages This avoids using the "magic" `isset` function implemented within the lesson_base class (which returns the `empty` function). In the case of the answer beeing `0`, the test fails and the answer is considered to be deleted. --- mod/lesson/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 812c5c8ee4f..7ce6b74bffd 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -4549,7 +4549,7 @@ abstract class lesson_page extends lesson_base { $this->answers[$i]->responseformat = $properties->response_editor[$i]['format']; } - if (isset($this->answers[$i]->answer) && $this->answers[$i]->answer != '') { + if ($this->answers[$i]->answer !== null && $this->answers[$i]->answer !== '') { if (isset($properties->jumpto[$i])) { $this->answers[$i]->jumpto = $properties->jumpto[$i]; }