Project: moodle
Issue MDL-38758: Undefined variable: sillybyrefvar in mod/forum/backup/moodle2/restore_forum_stepslib.php
While restoring the Moodle Features Demo course from the MOOCH hub to the latest 2.5dev, the last page of the restore displays the following notice: {code} Notice: Undefined variable: sillybyrefvar in .../mod/forum/backup/moodle2/restore_forum_stepslib.php on line 200 {code} This is a regression of MDL-30102 that changed the signature of the function: {code} -function forum_add_discussion($discussion, $mform=null, &$message=null, $userid=null) { +function forum_add_discussion($discussion, $mform=null, $unused=null, $userid=null) { {code} so that the third parameter is not passed by reference any more. As a consequence, the restore code: {code} $sdid = forum_add_discussion($sd, null, $sillybyrefvar, $this->task->get_userid()); {code} throws the notice as the $sillybyrefvar is not set there.
Story points: 5