Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47721

tag_get_correlated_tags causes error from get_records_sql

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.6.5, 2.7.2, 2.8
    • Tags
    • 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.

            Unassigned Unassigned
            nwpotago Nick Phillips
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.