From 1d723a169a5f55cc780942a36bd2ec207c31ff69 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 16 Aug 2006 16:17:18 +0000 Subject: [PATCH] Bug #6267 - questionlib.php delete_question infinite loop with rantom questions. Thanks to mbockol at carleton dot edu. Merged from MOODLE_16_STABLE. --- lib/questionlib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index f153365d1d..00b1c7eb94 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -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); + } } } -- 2.39.5