-
Bug
-
Resolution: Fixed
-
Minor
-
3.1.1
-
MOODLE_31_STABLE
-
MOODLE_30_STABLE, MOODLE_31_STABLE
-
MDL-55565-master -
-
3.2 Sprint 4
A minor bug resulting in debug output to the page, when in developer mode.
To replicate it:
- Make sure developer mode is on (DEBUG).
- Create a new course under the miscellaneous course category
- From within the question bank in the course, create 2 new question categories at the course-category level. (Course admin > Question bank > Categories)
- Select new category
- make sure the parent is 'Top' under the 'Miscellaneous' course category.
- you should now see three question categories in the section, 'Question categories for category: Miscellaneous':
- Default for miscellaneous
- First question category you created
- Second question category you created
- create a single question under any one of the course-category level question categories
- create a quiz, making sure to use that question you just created
- Now, backup the course (you can use 'Jump to final step')
- Restore the course into a new course, under the miscellaneous course category using all the default settings.
- You will see something like this:
Did you remember to make the first column something unique in your call to get_records? Duplicate value '3' found in column 'contextid'.
line 784 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
line 803 of /backup/util/dbops/restore_dbops.class.php: call to pgsql_native_moodle_database->get_records_sql()
line 602 of /backup/util/dbops/restore_dbops.class.php: call to restore_dbops::restore_find_best_target_context()
line 519 of /backup/util/dbops/restore_dbops.class.php: call to restore_dbops::prechek_precheck_qbanks_by_level()
line 178 of /backup/util/helper/restore_prechecks_helper.class.php: call to restore_dbops::precheck_categories_and_questions()
line 378 of /backup/controller/restore_controller.class.php: call to restore_prechecks_helper::execute_prechecks()
line 990 of /backup/util/ui/restore_ui_stage.class.php: call to restore_controller->execute_precheck()
line 372 of /backup/util/ui/restore_ui.class.php: call to restore_ui_stage_process->process()
line 99 of /backup/restore.php: call to restore_ui->requires_substage()
The warning is generated by a call to get_records_sql in restore_find_best_target_context(), which doesn't ask for a unique column correctly.
- Discovered while testing
-
MDL-54864 question_category.stamp should be unique, but this is not enforced
- Closed