Bug #6267 - questionlib.php delete_question infinite loop with rantom questions. Thanks to mbockol at carleton dot edu. Merged from MOODLE_16_STABLE.
This commit is contained in:
+3
-1
@@ -416,7 +416,9 @@ function delete_question($questionid) {
|
||||
// Now recursively delete all child questions
|
||||
if ($children = get_records('question', 'parent', $questionid)) {
|
||||
foreach ($children as $child) {
|
||||
delete_question($child->id);
|
||||
if ($child->id != $questionid) {
|
||||
delete_question($child->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user