Closed AndreaPiovanelli closed 1 month ago
Can you provide repro steps to compare before/after?
Can you provide repro steps to compare before/after?
The issue was easily reproducible when opening the edit page of an item containing a TaxonomyField. The ajax call in TaxonomyFieldList shape (https://github.com/LaserSrl/Orchard/blob/8ed7b67f1fc865e60b1de658b085fb49efb45151/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/EditorTemplates/Fields/TaxonomyFieldList.cshtml#L13) failed, showing the "Loading taxonomy failed" alert message at line 136 of the same file. The error wasn't logged by Orchard, because it's a MVC error, but you can see it in the browser console: Loading taxonomy fail message: The error displayed was the following: The current request for action 'GetTaxonomy' on controller type 'AdminLocalizedTaxonomyController' is ambiguous between the following action methods:
The current request for action 'GetTaxonomy' on controller type 'AdminLocalizedTaxonomyController' is ambiguous between the following action methods: System.Web.Mvc.ActionResult GetTaxonomy(System.String, System.String, Int32, System.String, System.String) on type Orchard.Taxonomies.Controllers.AdminLocalizedTaxonomyController System.Web.Mvc.ActionResult GetTaxonomy(System.String, System.String, Int32, System.String, System.String) on type Orchard.Taxonomies.Controllers.LocalizedTaxonomyController
I didn't notice this problem before PR #8780 was merged, because of the javascript syntax error blocking the proper execution of the code.
@AndreaPiovanelli please check the suggested changes and/or enable edits from maintainers.
@BenedekFarkas I took some time to test your suggestions in our environment and have now applied the changes you requested to current pr branch. I had to apply the last one separatedly (not via the "commit suggestion" button) because git disabled that button as apparently it was an "outdated suggestion" for it.
OK, thanks!
This fixes an ambiguity issue for the GetTaxonomy action of LocalizedTaxonomyController. There was a "new GetTaxonomy" action in AdminLocalizedTaxonomyController too that was ambiguous, failing to properly work. For this reason, the action has been removed from AdminLocalizedTaxonomyController and the admin filter is added via override of the ApplyPreRequest function.