Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-970 Problems with moodle.org for 2.0
  3. MDLSITE-1000

Tag functions tripping get_records warning about duplicate keys

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: moodle.org
    • Labels:
      None

      Description

      eg on http://moodle.org/tag/index.php?tag=guinness

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '1' found in column 'id'.

      • line 741 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
      • line 949 of /tag/lib.php: call to mysqli_native_moodle_database->get_records_sql()
      • line 458 of /tag/lib.php: call to tag_get_correlated()
      • line 106 of /tag/locallib.php: call to tag_get_related_tags()
      • line 93 of /tag/index.php: call to tag_print_description_box()

      Here is the line:

      if ( !$result = $DB->get_records_sql("SELECT 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})") ) {

      Is it because of the join? I think the DB is ok.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dougiamas Martin Dougiamas
              Reporter:
              dougiamas Martin Dougiamas
              Participants:
              Component watchers:
              Helen Foster
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: