From: stronk7 Date: Wed, 12 May 2004 20:39:34 +0000 (+0000) Subject: Bug 1296 solved. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=189bec8895457002b357098f128710b963bfd97c;p=moodle.git Bug 1296 solved. Now duplicate entries are showed in all the lists. Simply I've changed the fields order in select statements to make entryid (unique) the first. Not detected negative consequences...ciao :-) http://moodle.org/bugs/bug.php?op=show&bugid=1296 --- diff --git a/mod/glossary/sql.php b/mod/glossary/sql.php index 1daf3876ad..4e76635528 100644 --- a/mod/glossary/sql.php +++ b/mod/glossary/sql.php @@ -43,7 +43,7 @@ case GLOSSARY_CATEGORY_VIEW: if ($hook == GLOSSARY_SHOW_ALL_CATEGORIES ) { - $sqlselect = "SELECT gec.id, gc.name $as pivot, ge.*"; + $sqlselect = "SELECT ge.*, gec.id, gc.name $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}glossary_entries_categories gec, {$CFG->prefix}glossary_categories gc"; @@ -60,7 +60,7 @@ } elseif ($hook == GLOSSARY_SHOW_NOT_CATEGORISED ) { $printpivot = 0; - $sqlselect = "SELECT concept $as pivot, ge.*"; + $sqlselect = "SELECT ge.*, concept $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge"; $sqlwhere = "WHERE (glossaryid = '$glossary->id' OR sourceglossaryid = '$glossary->id') AND (ge.approved != 0 $userid)"; @@ -71,7 +71,7 @@ } else { $printpivot = 0; - $sqlselect = "SELECT ce.id, c.name $as pivot, ge.*"; + $sqlselect = "SELECT ge.*, ce.id, c.name $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}glossary_entries_categories ce, {$CFG->prefix}glossary_categories c"; $sqlwhere = "WHERE ge.id = ce.entryid AND ce.categoryid = $hook AND ce.categoryid = c.id AND ge.approved != 0 AND @@ -132,7 +132,7 @@ } } - $sqlselect = "SELECT ge.concept $as pivot, ge.*"; + $sqlselect = "SELECT ge.*, ge.concept $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge"; $sqlwhere = "WHERE (ge.glossaryid = $glossary->id OR ge.sourceglossaryid = $glossary->id) AND ge.approved = 0 $where"; @@ -146,7 +146,7 @@ case GLOSSARY_DATE_VIEW: case GLOSSARY_STANDARD_VIEW: default: - $sqlselect = "SELECT ge.concept $as pivot, ge.*"; + $sqlselect = "SELECT ge.*, ge.concept $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge"; $where = ''; @@ -223,6 +223,6 @@ break; } } - + $allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit"); ?>