]> git.mjollnir.org Git - moodle.git/commitdiff
Solved bug 985. Now "show" will work with aliases and with concepts
authorstronk7 <stronk7>
Wed, 12 May 2004 18:44:15 +0000 (18:44 +0000)
committerstronk7 <stronk7>
Wed, 12 May 2004 18:44:15 +0000 (18:44 +0000)
with and without aliases. Changed the cuery to a left join to
be able to process entries without aliases. This type of operation
should be changed to boolean queries sometime in MySQL 4!!
Test it!!
http://moodle.org/bugs/bug.php?op=show&bugid=985

mod/glossary/sql.php

index 9b818c8f7a4c0d9e379d5a16d4b8522ef73c130b..1daf3876adea5cf7a5a500a165caf4e17fead838 100644 (file)
         
         case 'term': 
             $printpivot = 0;
-            $sqlfrom .= ", {$CFG->prefix}glossary_alias ga";
-            $where = "AND ge.id = ga.entryid AND                            
-                          (ge.concept = '$hook' OR ga.alias = '$hook' )
+            $sqlfrom .= " left join {$CFG->prefix}glossary_alias ga on ge.id = ga.entryid ";
+            $where = "AND (ge.concept = '$hook' OR ga.alias = '$hook' )
                      ";
         break;
 
     break;
     } 
     $count = count_records_sql("select count(*) $sqlfrom $sqlwhere");
+
     $sqllimit = '';
     
     if ( $offset >= 0 ) {
     }
     
     $allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit");
-
-?>
\ No newline at end of file
+?>