OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Minor fixes for localizations #8726

Closed MatteoPiovanelli-Laser closed 3 months ago

MatteoPiovanelli-Laser commented 8 months ago

We found and fixed a few issues with some of the "automations" related to localizations for TaxonomyFields and BlogPosts.

TaxonomyFields would correctly update their editor UI when selecting a new culture, because the controller action wasn't called when it should have been. Moreover, we added an isAdmin parameter so we can correctly always use shapes from an admin theme when appropriate.

In BlogPosts, we were comparing Culture records rather than values: as a consequence, when creating a new localization, since the comparison ended up being between different instances of the same culture, the process failed to correctly "move" the translated BlogPost into its correct container.

This PR contains fixes for both.

AndreaPiovanelli commented 3 months ago

As suggested by @sebastienros , I duplicated the controller in order to have both a front-end and a admin controller. The latter inherits from the former to avoid having the GetTaxonomy function in both classes with the same code.