From 5c6418a97f8f8767614d1c56a5bee1027cdacc49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Tue, 30 Jan 2024 18:02:50 -0800 Subject: [PATCH] Fix string comparison changes in YesSql queries (#15212) --- .../Services/AliasPartContentHandleProvider.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs index 1f961b1440d..fc0dd6ecc64 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs @@ -34,6 +34,6 @@ public async Task GetContentItemIdAsync(string handle) internal class AliasPartContentHandleHelper { internal static Task QueryAliasIndex(ISession session, string alias) => - session.Query(x => x.Alias.Equals(alias, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefaultAsync(); + session.Query(x => x.Alias == alias.ToLowerInvariant()).FirstOrDefaultAsync(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs index de8be159574..7346fd590dd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs @@ -39,7 +39,7 @@ public override void ConfigureServices(IServiceCollection services) var session = context.Services.GetRequiredService(); var contentItem = await session.Query(x => - x.Published && x.Alias.Equals(alias, System.StringComparison.InvariantCultureIgnoreCase)) + x.Published && x.Alias == alias.ToLowerInvariant()) .FirstOrDefaultAsync(); if (contentItem == null)