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

Importing or merging courses fails (due to tags)



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Component/s: Backup, Questions, Tags
    • Labels:
    • Affected Branches:


      Moodle 3.2.1+ (Build: 20170112)

      We also have encountered the same problem with:
      Moodle 3.2.1 (Build: 20170109) Version 2016120501

      We have been unable to import content from one course into another. Specifically we would like to migrate two sections and the quizzes in them into another course, but the process repeated fails. We believe this to be because of a tag-related issue, but we cannot see any issues in the questions.xml file for the course we are importing. Debugging info is below:

      ------------------------ ERROR:

      Notice: Trying to get property of non-object in /var/www/html/moodle/backup/moodle2/restore_stepslib.php on line 4481

      Coding error detected, it must be fixed by a programmer: Invalid context id specified context::instance_by_id()

      More information about this error
      Debug info:
      Error code: codingerror
      Stack trace:

      line 5137 of /lib/accesslib.php: coding_exception thrown
      line 4481 of /backup/moodle2/restore_stepslib.php: call to context::instance_by_id()
      line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_create_categories_and_questions->process_tag()
      line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
      line 178 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 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
      line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
      line ? of unknownfile: call to progressive_parser->end_tag()
      line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
      line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
      line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
      line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
      line 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
      line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 335 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 162 of /backup/import.php: call to restore_controller->execute_plan()

      -------------------------- Script flagged by error:

      4479 // Add the tag to the question.
      4480 core_tag_tag::add_item_tag('core_question', 'question', $newquestion,
      4481 context::instance_by_id($this->cachedcategory->contextid),
      4482 $tagname);
      4483 }
      4484 }

      --------------------------------------------------- MISC:
      This may be related to this:

      Discussion thread on the topic:

        Balsamiq Wireframes


            Issue Links



                • Votes:
                  0 Vote for this issue
                  5 Start watching this issue


                  • Created: