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

Importing from 1.9 multichoices questions fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Backup
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      We're restoring from 1.9.9+ that contains multichoices
      After submitting the second step of the restore the process dies with:

      Debug info: Argument 1 passed to moodle1_qtype_multichoice_handler::write_multichoice() must be an array, null given, called in .../moodle/question/type/multichoice/backup/moodle1/lib.php on line 53 and defined

      The problem is that when calling:

      $this->write_multichoice($data['multichoice'], $data['oldquestiontextformat']);

      $data['multichoice'] is null

      The header of the function is
      protected function write_multichoice(array $multichoices, $oldquestiontextformat) {

      We've got two solutions
      1) Call the function only if $data['multichoice'] is not null
      2) Declaring first parameter not as as array (this is not tested)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                moodle.com moodle.com
                Reporter:
                pferre22 Pau Ferrer
                Participants:
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: