Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-38758

Undefined variable: sillybyrefvar in mod/forum/backup/moodle2/restore_forum_stepslib.php

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.5.2
    • 2.5
    • Forum
    • MOODLE_25_STABLE
    • MOODLE_25_STABLE
    • MDL-38758_master
    • Hide
      1. Create a course.
      2. Add a forum instance with the type set to 'A single simple discussion'.
      3. Backup the course.
      4. Restore the course but do not choose to restore any user info.
      5. Ensure you do not get the error described.
      Show
      Create a course. Add a forum instance with the type set to 'A single simple discussion'. Backup the course. Restore the course but do not choose to restore any user info. Ensure you do not get the error described.
    • 5
    • BACKEND Sprint 3

      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:

      Notice: Undefined variable: sillybyrefvar in .../mod/forum/backup/moodle2/restore_forum_stepslib.php on line 200
      

      This is a regression of MDL-30102 that changed the signature of the function:

      -function forum_add_discussion($discussion, $mform=null, &$message=null, $userid=null) {
      +function forum_add_discussion($discussion, $mform=null, $unused=null, $userid=null) {
      

      so that the third parameter is not passed by reference any more. As a consequence, the restore code:

      $sdid = forum_add_discussion($sd, null, $sillybyrefvar, $this->task->get_userid());
      

      throws the notice as the $sillybyrefvar is not set there.

            markn Mark Nelson
            mudrd8mz David Mudrák (@mudrd8mz)
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Sam Hemelryk Sam Hemelryk
            Petr Skoda Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.