OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.26k stars 2.35k forks source link

Content Localization Autoroute problem with culture name in path #15805

Open MichaelPetrinolis opened 3 months ago

MichaelPetrinolis commented 3 months ago

Describe the bug

There is an issue when you create multilingual content with the {{ Model.ContentItem.Content.LocalizationPart.Culture }} in the autoroute path pattern.

If you try to create a localized version of a content item, the pattern is not taken into account. The handler calls the GenerateUniqueAbsolutePathAsync to create a unique autoroute path by appending an integer to the original path to make it unique.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Localizable Content Type with Autoroute part attached and {{ Model.ContentItem.Content.LocalizationPart.Culture }}/{{ Model.ContentItem | display_text | slugify }} as the pattern.
  2. Configure two languages in the admin settings
  3. Create a new Content Item.
  4. Add a new localizable version

Expected behavior

The Localized version should reevaluate the autoroute pattern when publishing to take into account the translations made.

Piedone commented 3 months ago

The issue is that the original content item is completely copied, including its permalink.

hishamco commented 3 months ago

Ya because it's cloned, I will have a look