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

restoring a course displays error : Data too long for column 'answers' at row 1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.2.6
    • Questions
    • None
    • MOODLE_22_STABLE
    • Hide

      As a work-around, just edit that database table, and make change that column from VARCHAR(255) to VARCHAR(1333) (or even bigger).

      Show
      As a work-around, just edit that database table, and make change that column from VARCHAR(255) to VARCHAR(1333) (or even bigger).

      I've tried searching for similar issues associated with the answers field in the question_shortanswer table and they seem to imply that the field is no longer requred.
      what I did was ...
      Backup course and accept all the defaults. Include all the items and user data.
      Course backs up ok.
      On restoring course to a new course in an existing category the following error is displayed:

      Debug info: Data too long for column 'answers' at row 1
      INSERT INTO mdl_question_shortanswer (answers,usecase,question) VALUES(?,?,?)
      [array (
      0 => '2133251,2133252,2133253,2133254,2133255,2133256,2133257,2133258,2133259,2133260,2133261,2133262,2133263,2133264,2133265,2133266,2133267,2133268,2133269,2133270,2133271,2133272,2133273,2133274,2133275,2133276,2133277,2133278,2133279,2133280,2133281,2133282,2133283,2133284,2133285,2133286,',
      1 => '0',
      2 => 594077,
      )]
      Stack trace:

      line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 973 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1015 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 82 of /question/type/shortanswer/backup/moodle2/restore_qtype_shortanswer_plugin.class.php: call to mysqli_native_moodle_database->insert_record()
      line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_shortanswer_plugin->process_shortanswer()
      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 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
      line 46 of /backup/restore.php: call to restore_ui->execute()

      Course restores fine without quizes. The course was originally upgraded from 1.9.17

      Please let me know if you require anymore information.

            timhunt Tim Hunt
            ccaajoa Jo Matthews
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.