Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Linking global categories from within courses now works.

  • Loading branch information...
commit 6c884b58c933bffc67240429d6e1867fca81fcda 1 parent ceafd82
willcast authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 mod/glossary/dynalink.php
View
7 mod/glossary/dynalink.php
@@ -33,8 +33,8 @@ function glossary_dynamic_link($courseid, $text) {
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 @@ function glossary_dynamic_link($courseid, $text) {
$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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.