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:
tjhunt
2006-08-16 16:17:18 +00:00
parent 54121a7921
commit 1d723a169a
+3 -1
View File
@@ -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);
}
}
}