-
Bug
-
Resolution: Fixed
-
Minor
-
3.1.5, 3.2.2
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_32_STABLE, MOODLE_33_STABLE
-
MDL-58811-master-extra-slash -
When you try to duplicate a quiz which has some questions with images or other files URLs like '<img src="http://moodle.devbox16.local/file.php/6/RspQ-2010%20Carbonyl%20Quiz%201/q6ethbr.gif" alt="Q6EthBr" align="bottom" border="0">' it will fail with error_question_answers_missing_in_db
It happens because backup_xml_transformer::process_filephp_links on backup and restore_structure_parser_processor::process_cdata on restore treat $@FILEPHP@$ differently.
The first function replaces file path without a trailing slash, but the second function adds additional slash on restore.
Because of that restore_qtype_match_plugin::process_match can't match questiontext as data coming from XML has an extra slash and it fails with 'error_qtype_match_subquestion_missing_in_db' exception.
Steps to replicate:
- Create a course.
- Restore attached quiz activity into it
- Try to duplicate an activity.
As a side effect every time you backup and restore the activity again it adds more extra slashes to the file paths.
- Testing discovered
-
MDL-58954 Quiz restore fails when switching $CFG->slasharguments
- Closed