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

Allow "." in Autoroute Slugs #4576

Open orchardbot opened 10 years ago

orchardbot commented 10 years ago

danielsummers created: https://orchard.codeplex.com/workitem/20747

In the process of migrating a blog from WordPress to Orchard, I created an autoroute pattern of

{Content.Container.Path}/{Content.Date.Format:yyyy}/{Content.Slug}.html

to match the one I had in WordPress. This works; Orchard creates it, IIS serves it, etc. However, when I edit a page without modifying the URL, after clicking "Save" or "Publish Now", I get an error that a list of prohibited characters is in my slug. The offending character is the "." from the .html above.

I understand not wanting a "." in the actual slug; however, that validation logic (from AutorouteService.cs in the Orchard.Autoroute project) is also being applied to the entire permalink. On my local checkout, I've modified AutorouteService.cs line 169 to remove the period/full-stop character from the RegEx validation string. This allows me to edit the post without wiping out the slug to avoid the error.

orchardbot commented 9 years ago

@sebastienros commented:

I am opening this one just to find some answer, not that it's actually solvable.

Skrypt commented 9 years ago

I think that using AttributeRouting could be a solution. Would need to investigate more on that.

agriffard commented 8 years ago

Can it be solved?