]> git.mjollnir.org Git - moodle.git/commitdiff
- Linking global categories from within courses now works.
authorwillcast <willcast>
Sat, 21 Feb 2004 02:48:53 +0000 (02:48 +0000)
committerwillcast <willcast>
Sat, 21 Feb 2004 02:48:53 +0000 (02:48 +0000)
mod/glossary/dynalink.php

index b5e58d97c9436717e6a88d8b2d038e41f0b60d56..b337e4c130f13f446e6a1a4d0763fb0b62429a37 100644 (file)
@@ -33,8 +33,8 @@
                 break;
             }
             
-            $entries = get_records_select("glossary_entries", "glossaryid IN ($glossaries) AND usedynalink != 0 and approved != 0 and concept != ''","$ebylenght glossaryid","id,glossaryid,concept,casesensitive,$GLOSSARY_CONCEPT_IS_ENTRY category,fullmatch");
-            $categories  = get_records_select("glossary_categories", "glossaryid IN ($glossaries) AND usedynalink != 0", "$cbylenght glossaryid","id,glossaryid,name concept, 1 casesensitive,$GLOSSARY_CONCEPT_IS_CATEGORY category, 1 fullmatch");
+            $entries = get_records_select("glossary_entries", "glossaryid IN ($glossaries) AND usedynalink != 0 and approved != 0 and concept != ''","$ebylenght glossaryid","id,glossaryid, concept,casesensitive,$GLOSSARY_CONCEPT_IS_ENTRY category,fullmatch");
+            $categories  = get_records_select("glossary_categories", "glossaryid IN ($glossaries) AND usedynalink != 0", "$cbylenght glossaryid","id,glossaryid, name concept, 1 casesensitive,$GLOSSARY_CONCEPT_IS_CATEGORY category, 1 fullmatch");
             if ( $entries and $categories ) {
                 $concepts = array_merge($entries, $categories);
                 usort($concepts,'glossary_sort_entries_by_lenght');
@@ -54,7 +54,8 @@
                             $category = get_record("glossary_categories","id",$concept->id);
                             $lastcategory = $concept->id;
                             if ( $cm->instance != $category->glossaryid  ) {
-                                if ( !$cm = get_coursemodule_from_instance("glossary", $category->glossaryid, $courseid) ) {
+                                $gcat = get_record("glossary","id",$category->glossaryid);
+                                if ( !$cm = get_coursemodule_from_instance("glossary", $category->glossaryid, $gcat->course) ) {
                                     $cm->id = 1;
                                 }
                             }