Skip to content

Commit

Permalink
Fixing some queries with duplicate column names. MDL-7294
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 30, 2006
1 parent 5e8720e commit c97ab4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mod/glossary/print.php
Expand Up @@ -167,9 +167,9 @@
$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);
}

Expand Down
4 changes: 2 additions & 2 deletions mod/glossary/sql.php
Expand Up @@ -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";
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions mod/glossary/view.php
Expand Up @@ -354,11 +354,11 @@

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 {
Expand Down Expand Up @@ -433,4 +433,4 @@

print_footer($course);

?>
?>

0 comments on commit c97ab4b

Please sign in to comment.