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

when two users add the same tag to one course , get sql error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.6
    • Tags
    • None
    • MOODLE_26_STABLE

      when two users add the same tag to one course , get sql error:

      user A add a tag 'taga' to coursea
      then user B add tag 'taga' to coursea
      get the error:

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '1' found in column 'id'.
      line 1005 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
      line 336 of /tag/lib.php: call to mysqli_native_moodle_database->get_records_sql()
      line 405 of /tag/lib.php: call to tag_get_tags()
      line 245 of /tag/coursetagslib.php: call to tag_get_tags_ids()
      line 51 of /tag/coursetags_add.php: call to coursetag_store_keywords()

      file: /tag/lib.php
      line: 327

       $sql = "SELECT tg.id, tg.tagtype, tg.name, tg.rawname, tg.flag, ti.ordering
                    FROM {tag_instance} ti
                    JOIN {tag} tg ON tg.id = ti.tagid
                    WHERE ti.itemtype = :recordtype AND ti.itemid = :recordid $u $sql_type
                 ORDER BY ti.ordering ASC";
          $params['recordtype'] = $record_type;
          $params['recordid']   = $record_id;
       
          // if the fields in this query are changed, you need to do the same changes in tag_get_correlated_tags
          return $DB->get_records_sql($sql, $params);
      

            Unassigned Unassigned
            heran1038 Heran
            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.