NOBUG: Fix some queries preventing showentry "popup" to work
authorEloy Lafuente <stronk7@moodle.org>
Fri, 4 Jun 2010 08:26:11 +0000 (08:26 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Fri, 4 Jun 2010 08:26:11 +0000 (08:26 +0000)
mod/glossary/lib.php
mod/glossary/showentry.php

index eb530dd..ff6b3f4 100644 (file)
@@ -787,7 +787,7 @@ function glossary_get_entries_search($concept, $courseid) {
                                         e.glossaryid = g.id  AND
                                         ( (e.casesensitive != 0 AND LOWER(concept) = :conceptlower) OR
                                           (e.casesensitive = 0 and concept = :concept)) AND
-                                        (g.course = courseid2 OR g.globalglossary = 1) AND
+                                        (g.course = :courseid2 OR g.globalglossary = 1) AND
                                          e.usedynalink != 0 AND
                                          g.usedynalink != 0", $params);
 }
index f5ee187..0be68bb 100644 (file)
@@ -43,7 +43,7 @@ if ($entries) {
     foreach ($entries as $key => $entry) {
         // Need to get the course where the entry is,
         // in order to check for visibility/approve permissions there
-        $entrycourse = $DB->get_record('course', array('id', $entry->courseid), '*', MUST_EXIST);
+        $entrycourse = $DB->get_record('course', array('id' => $entry->courseid), '*', MUST_EXIST);
         $modinfo = get_fast_modinfo($entrycourse);
         // make sure the entry is visible
         if (empty($modinfo->cms[$entry->cmid]->uservisible)) {