]> git.mjollnir.org Git - moodle.git/commitdiff
Fixing some queries with duplicate column names. MDL-7294
authorstronk7 <stronk7>
Mon, 30 Oct 2006 19:02:58 +0000 (19:02 +0000)
committerstronk7 <stronk7>
Mon, 30 Oct 2006 19:02:58 +0000 (19:02 +0000)
Merged from MOODLE_17_STABLE

mod/glossary/print.php
mod/glossary/sql.php
mod/glossary/view.php

index c50038d9ed4af99b34347240797c6d7f6cd45a95..3fb99a46ade7b373961f7feabf07db0483b77cdf 100644 (file)
                     $currentpivot = $upperpivot;
 
                     $pivottoshow = $currentpivot;
-                    if ( isset($entry->uid) ) {
+                    if ( isset($entry->userid) ) {
                         // printing the user icon if defined (only when browsing authors)
-                        $user = get_record("user","id",$entry->uid);
+                        $user = get_record("user","id",$entry->userid);
                         $pivottoshow = fullname($user);
                     }
 
index 2f7cb3781d056a8dcdcf74c777755dc922da6c35..b24f6140529200cf8c817591dfc53b56585e33d6 100644 (file)
@@ -40,7 +40,7 @@
     case GLOSSARY_CATEGORY_VIEW:
         if ($hook == GLOSSARY_SHOW_ALL_CATEGORIES  ) { 
 
-            $sqlselect = "SELECT gec.id, ge.*, gec.entryid, gc.name AS glossarypivot";
+            $sqlselect = "SELECT gec.id AS cid, ge.*, gec.entryid, gc.name AS glossarypivot";
             $sqlfrom   = "FROM {$CFG->prefix}glossary_entries ge,
                          {$CFG->prefix}glossary_entries_categories gec,
                          {$CFG->prefix}glossary_categories gc";
@@ -91,7 +91,7 @@
             $where = '';
         }
 
-        $sqlselect  = "SELECT ge.id, $usernamefield AS glossarypivot, u.id as uid, ge.*";
+        $sqlselect  = "SELECT ge.*, $usernamefield AS glossarypivot ";
         $sqlfrom    = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}user u";
         $sqlwhere   = "WHERE ge.userid = u.id  AND
                              (ge.approved != 0 $userid)
index be84f4341b0c7472fe57d81b78ebbdb7b60a6f41..1df6a5a70ac8531633694a90eb7472c00cf970db 100644 (file)
 
                     echo '<tr>';
                     $pivottoshow = $currentpivot;
-                    if ( isset($entry->uid) ) {
+                    if ( isset($entry->userid) ) {
                     // printing the user icon if defined (only when browsing authors)
                         echo '<td align="left">';
 
-                        $user = get_record("user","id",$entry->uid);
+                        $user = get_record("user","id",$entry->userid);
                         print_user_picture($user->id, $course->id, $user->picture);
                         $pivottoshow = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
                     } else {
 
     print_footer($course);
 
-?>
\ No newline at end of file
+?>