When editing an existing cluster page in mod/lesson, the following error appears:
Notice: Undefined property: stdClass::$answer in /var/www/moodle2-dev/mod/lesson/locallib.php on line 2153
This blocks the workflow, but only if debuglevel is high enough and if errors are displayed within the HTML.
It appears the save script doesn't check for the presence of answers and just assumes there are some. The comment on this same file on the previous line (2152) assumes code doesn't need to make an isset() check because of the magic __isset() method used by the get_answers() getter. However, the getter is not used in this case.
I propose to simply add an isset() check in line 2153, replacing it like this:
if (isset($this->answers[$i]->answer) && $this->answers[$i]->answer != '') {
|
- is duplicated by
-
MDL-48675 Error displayed while editing content page jumps in the lesson
-
- Closed
-