Removing supported cultures breaks AutorouteSettings
Steps to reproduce:
- Start with a website that has 1 supported culture (in my case nl-BE)
- Create a new Content Type that has an AutoroutePart attached
- 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)
- Save the content definition of the Content Type you just created
- Remove the culture you previously added
- 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.
Nah it was working someone broke it.
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.
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.