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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.2
    • Component/s: Forum
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-38758_master
    • Story Points:
      5
    • Sprint:
      BACKEND Sprint 3

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              mudrd8mz David Mudrák (@mudrd8mz)
              Peer reviewer:
              David Mudrák (@mudrd8mz)
              Integrator:
              Sam Hemelryk
              Tester:
              Petr Skoda
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Sep/13