From fc8b681b4e7522a5cec29944d57f00a602b6b374 Mon Sep 17 00:00:00 2001 From: Andrea Piovanelli <83577153+AndreaPiovanelli@users.noreply.github.com> Date: Thu, 16 May 2024 17:16:43 +0200 Subject: [PATCH] Ambiguity in LocalizedTaxonomyController action names (#8785) * Removed ambiguity to LocalizedTaxonomyController actions. * Properly added ApplyPreRequest to the action. * Code refactoring * Code autoformatting * Sorting using * Overriding GetTaxonomy action * Calling base GetTaxonomy action * Removing ApplyPreRequest function * Removed ApplyPreRequest function * Added virtual keyword to GetTaxonomy action in LocalizedTaxonomyController --------- Co-authored-by: Benedek Farkas --- .../Controllers/AdminLocalizedTaxonomyController.cs | 9 ++++----- .../Controllers/LocalizedTaxonomyController.cs | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/AdminLocalizedTaxonomyController.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/AdminLocalizedTaxonomyController.cs index 7dbc4f43db3..042eb1d718c 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/AdminLocalizedTaxonomyController.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/AdminLocalizedTaxonomyController.cs @@ -1,5 +1,5 @@ using System.Web.Mvc; -using System.Web.Routing; +using System.Web.Routing; using Orchard.ContentManagement.MetaData; using Orchard.Environment.Extensions; using Orchard.Localization.Services; @@ -25,10 +25,9 @@ public AdminLocalizedTaxonomyController(IContentDefinitionManager contentDefinit } [OutputCache(NoStore = true, Duration = 0)] - public new ActionResult GetTaxonomy(string contentTypeName, string taxonomyFieldName, int contentId, string culture, string selectedValues) { + public override ActionResult GetTaxonomy(string contentTypeName, string taxonomyFieldName, int contentId, string culture, string selectedValues) { AdminFilter.Apply(_requestContext); - - return GetTaxonomyInternal(contentTypeName, taxonomyFieldName, contentId, culture, selectedValues); + return base.GetTaxonomy(contentTypeName, taxonomyFieldName, contentId, culture, selectedValues); } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/LocalizedTaxonomyController.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/LocalizedTaxonomyController.cs index c58c07b0649..a7647b6c508 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/LocalizedTaxonomyController.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/LocalizedTaxonomyController.cs @@ -35,11 +35,11 @@ public LocalizedTaxonomyController( } [OutputCache(NoStore = true, Duration = 0)] - public ActionResult GetTaxonomy(string contentTypeName, string taxonomyFieldName, int contentId, string culture, string selectedValues) { + public virtual ActionResult GetTaxonomy(string contentTypeName, string taxonomyFieldName, int contentId, string culture, string selectedValues) { return GetTaxonomyInternal(contentTypeName, taxonomyFieldName, contentId, culture, selectedValues); } - protected ActionResult GetTaxonomyInternal (string contentTypeName, string taxonomyFieldName, int contentId, string culture, string selectedValues) { + protected ActionResult GetTaxonomyInternal(string contentTypeName, string taxonomyFieldName, int contentId, string culture, string selectedValues) { var viewModel = new TaxonomyFieldViewModel(); bool autocomplete = false; var contentDefinition = _contentDefinitionManager.GetTypeDefinition(contentTypeName);