From d0e0dd9e3d0d08b5c8e5f5b2d9f5ebd57bee9dc9 Mon Sep 17 00:00:00 2001 From: Antoine Griffard Date: Sat, 9 Nov 2024 17:06:00 +0100 Subject: [PATCH] Fix build errors --- .../OrchardCore.AdminDashboard/Migrations.cs | 1 - src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs | 1 - .../Deployment/AzureADDeploymentSource.cs | 1 + .../Deployment/MicrosoftAccountDeploymentSource.cs | 1 + .../Deployment/OpenIdServerDeploymentSource.cs | 1 - .../Deployment/OpenIdValidationDeploymentSource.cs | 2 +- src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs | 1 - .../Values/CultureValue.cs | 2 +- .../Values/HostingEnvironmentValue.cs | 2 +- .../Services/ElasticIndexManager.cs | 4 ++-- .../Handlers/UrlRedirectRuleHandler.cs | 2 +- src/docs/reference/modules/Workflows/README.md | 2 +- 12 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Migrations.cs index 0f775b80c78..823acb07a7a 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminDashboard/Migrations.cs @@ -1,6 +1,5 @@ using OrchardCore.AdminDashboard.Indexes; using OrchardCore.ContentManagement.Metadata; -using OrchardCore.ContentManagement.Metadata.Settings; using OrchardCore.Data.Migration; using OrchardCore.Recipes; using OrchardCore.Recipes.Services; diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs index c08f6df7e85..100405e16b5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs @@ -16,7 +16,6 @@ using OrchardCore.Data; using OrchardCore.Data.Migration; using OrchardCore.DisplayManagement; -using OrchardCore.DisplayManagement.Descriptors; using OrchardCore.Indexing; using OrchardCore.Liquid; using OrchardCore.Modules; diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/AzureADDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/AzureADDeploymentSource.cs index d2c46d90469..d7ebe2202a9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/AzureADDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/AzureADDeploymentSource.cs @@ -1,6 +1,7 @@ using System.Text.Json.Nodes; using OrchardCore.Deployment; using OrchardCore.Microsoft.Authentication.Services; +using OrchardCore.Microsoft.Authentication.Settings; namespace OrchardCore.Microsoft.Authentication.Deployment; diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/MicrosoftAccountDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/MicrosoftAccountDeploymentSource.cs index fc63df14d54..ba9222e474c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/MicrosoftAccountDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Deployment/MicrosoftAccountDeploymentSource.cs @@ -1,6 +1,7 @@ using System.Text.Json.Nodes; using OrchardCore.Deployment; using OrchardCore.Microsoft.Authentication.Services; +using OrchardCore.Microsoft.Authentication.Settings; namespace OrchardCore.Microsoft.Authentication.Deployment; diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdServerDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdServerDeploymentSource.cs index db7f2374f0b..47a7047f60d 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdServerDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdServerDeploymentSource.cs @@ -2,7 +2,6 @@ using OrchardCore.Deployment; using OrchardCore.OpenId.Recipes; using OrchardCore.OpenId.Services; -using OrchardCore.OpenId.Settings; namespace OrchardCore.OpenId.Deployment; diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdValidationDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdValidationDeploymentSource.cs index f0a782f5a10..ec42a95cfe5 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdValidationDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/Deployment/OpenIdValidationDeploymentSource.cs @@ -21,7 +21,7 @@ protected override async Task ProcessAsync(OpenIdValidationDeploymentStep step, result.Steps.Add(new JsonObject { - ["name"] = "OpenIdValidationSettings", + ["name"] = nameof(OpenIdValidationSettings), ["OpenIdValidationSettings"] = JObject.FromObject(validationSettings), }); } diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs index fa8382b3eb8..24f59367b42 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs @@ -30,7 +30,6 @@ using OrchardCore.OpenId.Settings; using OrchardCore.OpenId.Tasks; using OrchardCore.Recipes; -using OrchardCore.Recipes.Services; using OrchardCore.Security; using OrchardCore.Security.Permissions; using OrchardCore.Settings; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs index a8ab8113a70..f234d98cb59 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs @@ -58,7 +58,7 @@ public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo #pragma warning restore CS0672 // Member overrides obsolete member => writer.Write(Culture.Name); - public async override ValueTask WriteToAsync(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) + public override async ValueTask WriteToAsync(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) => await writer.WriteAsync(Culture.Name); public override ValueTask GetValueAsync(string name, TemplateContext context) diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/HostingEnvironmentValue.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/HostingEnvironmentValue.cs index 67b51e813d1..cb02e3dc9f6 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/HostingEnvironmentValue.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/HostingEnvironmentValue.cs @@ -39,7 +39,7 @@ public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo #pragma warning restore CS0672 // Member overrides obsolete member => writer.Write(ToStringValue()); - public async override ValueTask WriteToAsync(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) + public override async ValueTask WriteToAsync(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) => await writer.WriteAsync(ToStringValue()); public override ValueTask GetValueAsync(string name, TemplateContext context) diff --git a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs index f6a1ea5256e..09c7177177a 100644 --- a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs +++ b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs @@ -42,7 +42,7 @@ public sealed class ElasticIndexManager { ElasticsearchConstants.StopAnalyzer, () => new StopAnalyzer() }, }; - private List _tokenFilterNames = new List() + private readonly List _tokenFilterNames = new List() { "asciifolding", "common_grams", @@ -457,7 +457,7 @@ public async Task CreateIndexAsync(ElasticIndexSettings elasticIndexSettin { var analyzer = CreateAnalyzer(analyzerProperties); analysisDescriptor.Analyzers(a => a.UserDefined(analyzerName, analyzer)); - } + } indexSettingsDescriptor = new IndexSettingsDescriptor(); indexSettingsDescriptor.Analysis(an => analysisDescriptor); diff --git a/src/OrchardCore/OrchardCore.UrlRewriting.Core/Handlers/UrlRedirectRuleHandler.cs b/src/OrchardCore/OrchardCore.UrlRewriting.Core/Handlers/UrlRedirectRuleHandler.cs index f73a21ebb77..46c71fbd04a 100644 --- a/src/OrchardCore/OrchardCore.UrlRewriting.Core/Handlers/UrlRedirectRuleHandler.cs +++ b/src/OrchardCore/OrchardCore.UrlRewriting.Core/Handlers/UrlRedirectRuleHandler.cs @@ -95,7 +95,7 @@ private static Task PopulateAsync(RewriteRule rule, JsonNode data) { metadata.RedirectType = redirectType.Value; } - else if (!Enum.IsDefined(typeof(RedirectType), metadata.RedirectType)) + else if (!Enum.IsDefined(metadata.RedirectType)) { metadata.RedirectType = RedirectType.Found; } diff --git a/src/docs/reference/modules/Workflows/README.md b/src/docs/reference/modules/Workflows/README.md index 415ab84566c..9252e5e7246 100644 --- a/src/docs/reference/modules/Workflows/README.md +++ b/src/docs/reference/modules/Workflows/README.md @@ -416,7 +416,7 @@ public abstract class ActivityDisplayDriver : Activit return Initialize(_editShapeType, viewModel => EditActivityAsync(activity, viewModel)).Location("Content"); } - public async override Task UpdateAsync(TActivity activity, UpdateEditorContext context) + public override async Task UpdateAsync(TActivity activity, UpdateEditorContext context) { var viewModel = new TEditViewModel(); if (await context.Updater.TryUpdateModelAsync(viewModel, Prefix))