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

Restore of old 2.0 course backup failing with questions stuff

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7
    • 2.7
    • Backup, Questions, Quiz
    • MOODLE_27_STABLE
    • MOODLE_27_STABLE
    • Hide
      1. Make a quiz on a Moodle 2.0 site (but without any randomsamatch questions).
      2. Attempt the quiz as a student.
      3. Back up the course with user data
      4. Restore it into a master install.
      5. Verify there are no errors during restore.
      6. Verify that the restored quiz and attempts are an accurate copy.
      Show
      Make a quiz on a Moodle 2.0 site (but without any randomsamatch questions). Attempt the quiz as a student. Back up the course with user data Restore it into a master install. Verify there are no errors during restore. Verify that the restored quiz and attempts are an accurate copy.

    Description

      This is apparently a regression of MDL-43670, where some quiz_question_instances columns were renamed.

      Trying to restore the attached course backup (2.0 one), the process dies with error:

      Error reading from database
       
      More information about this error
       
      Debug info: Unknown column 'qqi.grade' in 'field list'
       
      SELECT q.*, qqi.grade AS maxmark
      FROM mdl_question q
      JOIN mdl_quiz_question_instances qqi ON qqi.question = q.id
      WHERE q.id = 1 AND qqi.quiz = 1
      [array (
      )]
      Error code: dmlreadexception
      Stack trace:
      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 1014 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1476 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 471 of /question/engine/upgrade/upgradelib.php: call to moodle_database->get_record_sql()
      line 507 of /question/engine/upgrade/upgradelib.php: call to question_engine_upgrade_question_loader->load_question()
      line 308 of /question/engine/upgrade/upgradelib.php: call to question_engine_upgrade_question_loader->get_question()
      line 4264 of /backup/moodle2/restore_stepslib.php: call to question_engine_attempt_upgrader->load_question()
      line 345 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to restore_questions_activity_structure_step->process_legacy_quiz_attempt_data()
      line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_quiz_activity_structure_step->process_quiz_attempt_legacy()
      ...
      ...
      

      It's seems that some ocurrence of the old names is still there.

      Reproduction note: In order to reproduce the error, the attached backup file must be restored skipping the "One Quiz" activity completely (it contains some qtypes not present in 2.7 leading to error, unrelated with this issue).

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              stronk7 Eloy Lafuente (stronk7)
              Jean-Michel Vedrine Jean-Michel Vedrine
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              David Monllaó David Monllaó
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Safat Shahin, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/May/14