-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.6
-
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); |
- duplicates
-
MDL-25138 tag_get_tags() and tag_get_correlated() need to return unique records
-
- Closed
-