From 5c6522115b9d1bead40430462bb1cadea80069fd Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 2 Sep 2008 06:55:40 +0000 Subject: [PATCH] MDL-14160 SQL in get_categories_for_contexts does not work on Oracle. Thanks to Adrian Smith and Francois Marier for the fix. --- lib/questionlib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index 30704fecb5c..30643ca2511 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1927,7 +1927,7 @@ function question_make_default_categories($contexts) { function get_categories_for_contexts($contexts, $sortorder = 'parent, sortorder, name ASC') { global $CFG; return get_records_sql(" - SELECT *, (SELECT count(1) FROM {$CFG->prefix}question q + SELECT c.*, (SELECT count(1) FROM {$CFG->prefix}question q WHERE c.id = q.category AND q.hidden='0' AND q.parent='0') as questioncount FROM {$CFG->prefix}question_categories c WHERE c.contextid IN ($contexts)