From 7a88fd96b9a7ca3e3c0bf8a9134a832161370ae5 Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 14 Apr 2026 13:16:47 -0400 Subject: [PATCH] Highlighter issue --- .../Components/Pages/Content/HighlightConfigPage.razor | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor b/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor index f289fc2..e51c764 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/HighlightConfigPage.razor @@ -159,8 +159,12 @@ else _message = null; try { + var normalizedType = row.Config.HighlightType.Trim(); + var normalizedTypeLower = normalizedType.ToLowerInvariant(); + row.Config.HighlightType = normalizedType; + var tracked = await Db.HighlightConfigs - .FirstOrDefaultAsync(h => string.Equals(h.HighlightType, row.Config.HighlightType, StringComparison.OrdinalIgnoreCase)); + .FirstOrDefaultAsync(h => h.HighlightType.ToLower() == normalizedTypeLower); if (tracked is null) { @@ -181,7 +185,7 @@ else _isError = false; // Re-attach the tracked entity to the row so future saves go through the tracked path. - if (!Db.HighlightConfigs.Local.Any(h => h.HighlightType == row.Config.HighlightType)) + if (!Db.HighlightConfigs.Local.Any(h => string.Equals(h.HighlightType, row.Config.HighlightType, StringComparison.OrdinalIgnoreCase))) Db.Entry(row.Config).State = Microsoft.EntityFrameworkCore.EntityState.Detached; } catch (Exception ex)