From 9f64eef7fd12b601296b99170c1840a00ef0abc0 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 27 Nov 2008 05:57:11 +0000 Subject: [PATCH] health centre: MDL-16935 Question categories should belong to a valid context solution has SQL that does not work in MySQL --- admin/health.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/health.php b/admin/health.php index 56d5d29416..7ef0a8b119 100644 --- a/admin/health.php +++ b/admin/health.php @@ -659,10 +659,10 @@ class problem_000015 extends problem_base { function solution() { global $CFG; return '

You can delete the empty categories by executing the following SQL:

-DELETE FROM ' . $CFG->prefix . 'question_categories qc
+DELETE FROM ' . $CFG->prefix . 'question_categories
 WHERE
-    NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'question q WHERE q.category = qc.id)
-AND NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'context con WHERE qc.contextid = con.id)
+    NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'question q WHERE q.category = ' . $CFG->prefix . 'question_categories.id)
+AND NOT EXISTS (SELECT * FROM ' . $CFG->prefix . 'context con WHERE contextid = con.id)
         

Any remaining categories that contain questions will require more thought. ' . 'People in the Quiz forum may be able to help.

'; } -- 2.39.5