From: tjhunt Date: Thu, 27 Nov 2008 05:57:11 +0000 (+0000) Subject: health centre: MDL-16935 Question categories should belong to a valid context solutio... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9f64eef7fd12b601296b99170c1840a00ef0abc0;p=moodle.git health centre: MDL-16935 Question categories should belong to a valid context solution has SQL that does not work in MySQL --- 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.

'; }