From 940fca1a36cb516782134407e86209b8caf8bd02 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 9 Mar 2004 16:30:36 +0000 Subject: [PATCH] Fixed a little bug when glossary filter called from front page or anywhere else a course is not defined --- mod/glossary/filter.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mod/glossary/filter.php b/mod/glossary/filter.php index f078d0fcc8..1fccd3dfe8 100644 --- a/mod/glossary/filter.php +++ b/mod/glossary/filter.php @@ -7,17 +7,23 @@ } function glossary_dynamic_link($courseid, $text) { - global $CFG; + global $CFG; + + if (empty($courseid)) { + if ($site = get_site()) { + $courseid = $site->id; + } + } $GLOSSARY_CONCEPT_IS_ENTRY = 0; $GLOSSARY_CONCEPT_IS_CATEGORY = 1; switch ($CFG->dbtype) { - case 'postgres7': - $as = 'as'; - break; - case 'mysql': - $as = ''; - break; + case 'postgres7': + $as = 'as'; + break; + case 'mysql': + $as = ''; + break; } $glossarieslist = get_records_select("glossary", "usedynalink != 0 and (course = $courseid or globalglossary != 0)","globalglossary, id"); -- 2.39.5