From ee8bc9d180fbf93acbbaf3c6c3789be009293fc0 Mon Sep 17 00:00:00 2001 From: scyrma Date: Wed, 5 Mar 2008 10:15:52 +0000 Subject: [PATCH] MDL-13791 - fix to prevent notice --- tag/locallib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tag/locallib.php b/tag/locallib.php index 8f46e31dafd..e2c26d53308 100644 --- a/tag/locallib.php +++ b/tag/locallib.php @@ -21,10 +21,12 @@ function tag_print_cloud($nr_of_tags=150, $return=false) { $can_manage_tags = has_capability('moodle/tag:manage', get_context_instance(CONTEXT_SYSTEM)); - $tagcloud = get_records_sql('SELECT tg.rawname, tg.id, tg.name, tg.tagtype, COUNT(ti.id) AS count, tg.flag '. + if ( !$tagcloud = get_records_sql('SELECT tg.rawname, tg.id, tg.name, tg.tagtype, COUNT(ti.id) AS count, tg.flag '. 'FROM '. $CFG->prefix .'tag_instance ti INNER JOIN '. $CFG->prefix .'tag tg ON tg.id = ti.tagid '. 'GROUP BY tg.id, tg.rawname, tg.name, tg.flag, tg.tagtype '. - 'ORDER BY count DESC, tg.name ASC', 0, $nr_of_tags); + 'ORDER BY count DESC, tg.name ASC', 0, $nr_of_tags) ) { + $tagcloud = array(); + } $totaltags = count($tagcloud); $currenttag = 0;