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

Restore of old 2.0 course backup failing with questions stuff

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: Backup, Questions, Quiz
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Peer reviewer:
                Jean-Michel Vedrine
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                David Monllaó
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias, Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14