Skip to content

Commit

Permalink
MDL-25138 core_tag: fix correlated tags query unique error
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed May 13, 2015
1 parent 753d681 commit da7f951
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tag/lib.php
Expand Up @@ -1384,10 +1384,11 @@ function tag_get_correlated($tag_id, $limitnum=null) {
}

// this is (and has to) return the same fields as the query in tag_get_tags
$sql = "SELECT DISTINCT tg.id, tg.tagtype, tg.name, tg.rawname, tg.flag, ti.ordering
$sql = "SELECT ti.id AS taginstanceid, tg.id, tg.tagtype, tg.name, tg.rawname, tg.flag, ti.ordering
FROM {tag} tg
INNER JOIN {tag_instance} ti ON tg.id = ti.tagid
WHERE tg.id IN ({$tag_correlation->correlatedtags})";
WHERE tg.id IN ({$tag_correlation->correlatedtags})
ORDER BY ti.ordering ASC";
$result = $DB->get_records_sql($sql);
if (!$result) {
return array();
Expand Down

0 comments on commit da7f951

Please sign in to comment.