Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1
    • 2.1
    • Questions
    • None
    • MOODLE_21_STABLE
    • MOODLE_21_STABLE
    • Hide

      Restore the file David attached. Or, for a more stringent test, make a backup from a different Moodle 2.0 course containing lots of questions, including matching questions, and restore that.

      Show
      Restore the file David attached. Or, for a more stringent test, make a backup from a different Moodle 2.0 course containing lots of questions, including matching questions, and restore that.

    Description

      While testing MDL-22414 with the new QE2, I discovered some issues with the restore of the converted backup.

      Error writing to database
       
      Debug info: ERROR: null value in column "correctfeedback" violates not-null constraint
      INSERT INTO mdl_question_match (shuffleanswers,subquestions,question) VALUES($1,$2,$3) RETURNING id
      [array (
      'shuffleanswers' => '1',
      'subquestions' => '1,2,3',
      'question' => 1319,
      )]
      Stack trace:
       
          * line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
          * line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          * line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          * line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
          * line 80 of /question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php: call to pgsql_native_moodle_database->insert_record()
          * line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_match_plugin->process_matchoptions()
          * line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
          * line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
          * line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
          * line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
          * line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
          * line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
          * line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
          * line ? of unknownfile: call to progressive_parser->end_tag()
          * line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
          * line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
          * line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
          * line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
          * line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
          * line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
          * line 299 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
          * line 144 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
          * line 45 of /backup/restore.php: call to restore_ui->execute()

      In the chat, Tim suggested that the restore process should supply defaults for the fields if they are not in the XML. Please note I did not have a chance to test further as this error stops the course restore.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              mudrd8mz David Mudrák (@mudrd8mz)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Sam Hemelryk Sam Hemelryk
              Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Sabina Abellan, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1/Jul/11