You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure tag operations are case insensitive on insert across database types (#19439)
* Ensure tag operations are case insensitve on insert across database types.
* Ensure tags provided in a single property are case insensitively distinct when saving the tags and relationships.
* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TagRepository.cs
Co-authored-by: Copilot <[email protected]>
* Handle case sensitivity on insert with tag groups too.
---------
Co-authored-by: Copilot <[email protected]>
LEFT OUTER JOIN cmsTags ON (tagSet.tag = cmsTags.tag AND tagSet.{group} = cmsTags.{group} AND COALESCE(tagSet.languageId, -1) = COALESCE(cmsTags.languageId, -1))
137
+
LEFT OUTER JOIN cmsTags ON (LOWER(tagSet.tag) = LOWER(cmsTags.tag) AND LOWER(tagSet.{group}) = LOWER(cmsTags.{group}) AND COALESCE(tagSet.languageId, -1) = COALESCE(cmsTags.languageId, -1))
135
138
WHERE cmsTags.id IS NULL";
136
139
137
140
Database.Execute(sql1);
@@ -142,7 +145,7 @@ LEFT OUTER JOIN cmsTags ON (tagSet.tag = cmsTags.tag AND tagSet.{group} = cmsTag
142
145
FROM (
143
146
SELECT t.Id
144
147
FROM {tagSetSql}
145
-
INNER JOIN cmsTags as t ON (tagSet.tag = t.tag AND tagSet.{group} = t.{group} AND COALESCE(tagSet.languageId, -1) = COALESCE(t.languageId, -1))
148
+
INNER JOIN cmsTags as t ON (LOWER(tagSet.tag) = LOWER(t.tag) AND LOWER(tagSet.{group}) = LOWER(t.{group}) AND COALESCE(tagSet.languageId, -1) = COALESCE(t.languageId, -1))
146
149
) AS tagSet2
147
150
LEFT OUTER JOIN cmsTagRelationship r ON (tagSet2.id = r.tagId AND r.nodeId = {contentId} AND r.propertyTypeID = {propertyTypeId})
148
151
WHERE r.tagId IS NULL";
@@ -246,14 +249,18 @@ private class TagComparer : IEqualityComparer<ITag>
246
249
{
247
250
publicboolEquals(ITag?x,ITag?y)=>
248
251
ReferenceEquals(x,y)// takes care of both being null
0 commit comments