Orchard icon indicating copy to clipboard operation
Orchard copied to clipboard

Removing supported cultures breaks AutorouteSettings

Open Lawyerson opened this issue 7 years ago • 3 comments

Steps to reproduce:

  1. Start with a website that has 1 supported culture (in my case nl-BE)
  2. Create a new Content Type that has an AutoroutePart attached
  3. Add an additional supported culture to your site (in my case en-US, which alphabetically comes before nl-BE but I'm not sure if that's relevant)
  4. Save the content definition of the Content Type you just created
  5. Remove the culture you previously added
  6. Try to save the content definition of your Content Type again, it will throw an ArgumentOutOfRange exception.

I ran into this with Orchard 1.10.2 but the issue possibly exists since culture patterns were introduced. The exception occurs at line 113 in Orchard.Autoroute.Settings.AutorouteSettingsEvents, where AutorouteSettings.Patterns will still contain a pattern for the removed culture but not for the site's main culture.

Lawyerson avatar Feb 28 '19 11:02 Lawyerson

Nah it was working someone broke it.

Skrypt avatar Feb 28 '19 13:02 Skrypt

Do you think you can provide a PR ?

I assume the mitigation is to delete the custom pattern for this culture before you change the settings.

sebastienros avatar Feb 28 '19 20:02 sebastienros

Do you think you can provide a PR ?

I assume the mitigation is to delete the custom pattern for this culture before you change the settings.

I'm developing against a local TFS copy, so it would be easier for someone more invested in the project to do it.

Lawyerson avatar Mar 21 '19 15:03 Lawyerson