I am currently looking for the cause of issue MDL-63260.
To do this, I am examining the two classes, restore_controller and backup_controller.
/backup/controller/_____.class.php
The symptoms of this bug are described below.
My request
If you know of other components which I should investigate, please point me toward them.Tracing the source
Selecting "Duplicate" on a quiz activates /course/mod.php,which passes a course module to duplicate_module() of lib.php
lib.php then uses the course module as an argument for
- new backup_controller()
- new restore_controller()
- $DB->setfield()
So far, I have not found any loops.
Current assumption
The problem is NOT caused by DB->set_field(), otherwise users would complain of exponential growth on many other tables.
Symptom summary
The symptom appears in the table, mdl_question.
When a quiz is duplicated multiple times,
each question in the quiz is appended to the table a number of times equal to 2^(n-1) , where n equals the number of duplicates created.
For example, a Moodle installation with only 1 quiz and 1 question will generate the following table after the quiz has been duplicated 4 times.
16 rows = (1 original quiz) + 2^0 + 2^1 + 2^2 + 2^3
= (1 original quiz) + 4 duplicates
(the ID of 16 in my example is irrelevant)
More details about the symptom are beautifully described here: MDL-63260
= (1 original quiz) + 4 duplicates
(the ID of 16 in my example is irrelevant)
More details about the symptom are beautifully described here: MDL-63260