-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.6.5, 2.7.2, 2.8
-
None
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
tag_get_correlated_tags (in tag/lib.php) causes a "Did you remember to make the first column something unique" error in get_records_sql, as the presence of the "ordering" column allows the "DISTINCT" to return more than one row per tag id.
The data in the ordering column is completely meaningless in the output from this query anyway, and if it really does have to be included at all, it should probably return a fixed zero value (i.e. replace "ti.ordering" in the query with "0 as ordering").
However, given that the data is meaningless, I have to question the assertion that the columns returned by tag_get_correlated_tags must match those returned by tag_get_tags – if any code is actually using this data without being aware which function returned it, it is using garbage data. Either the assertion is incorrect, or the design is.
- duplicates
-
MDL-25138 tag_get_tags() and tag_get_correlated() need to return unique records
-
- Closed
-