Open MikeKry opened 3 years ago
Which version of Orchard Core @MikeKry ?
I fixed this here https://github.com/OrchardCMS/OrchardCore/pull/6065/files
So would be disappointed if it has returned :(
@deanmarcussen 1.0.0-rc2-14859 Not sure how to get nuget version from pull request, but considering date of merge, I guess your fix should be included in it.
Anyway, this happened to me multiple times in past, e.g. with activation of some feature etc.. Maybe there could be some maintenance mode in which last changes could be reverted.
Or maybe it would be possible to implement some check if next request will not cause exception and save only if its ok. (Something like transaction processing and revert if anything fails.. not applicable to this case though)
@deanmarcussen
Adding some more examples:
"localhost:8000/" + "/" - ok "localhost:8000/" + "something//other - error so problem is only in path after base path (localhost:8000/"
@MikeKry I can't repro the issue on the latest dev.
Errors in the path are correctly validated.
If you can update to the latest and still repro please re open
It is still broken on new version, but there are two different use cases
@deanmarcussen
Also, i can not reopen this issue, because it is closed by You.
Ok, so we might need to validate the output of the liquid pattern.
No options here for returning an invalid path to the user, as it is calculated in the handler.
We could
Model.DisplayText
may contain invalid characters), and strip (with log) invalid characters from the output.Slight note, when we decide what the preference is here, we also need to add {
and }
to the list of InvalidCharactersForPath
Add validation in the driver once the pattern is evaluated.
@MikeKry to you want to try and create a PR for that?
@sebastienros I could give it a try, but it will take some time to study related architecture patterns, maybe some tips would be helpful.
When: Invalid route is filled in AutoRoutePart
Then: OrchardCore CMS fails to render Content items list with error
Also: It is not possible to remove invalid item, only if user remembers edit link of that content item
full exception:
Click to expand!
RoutePatternException: The route template separator character '/' cannot appear consecutively. It must be separated by either a parameter or a literal value. Microsoft.AspNetCore.Routing.Patterns.RoutePatternParser.Parse(string pattern) Microsoft.AspNetCore.Routing.Patterns.RoutePatternFactory.Parse(string pattern, object defaults, object parameterPolicies) OrchardCore.Autoroute.Routing.AutoRouteValuesAddressScheme.FindEndpoints(RouteValuesAddress address) in AutorouteValuesAddressScheme.cs OrchardCore.Routing.ShellRouteValuesAddressScheme.FindEndpoints(RouteValuesAddress address) in ShellRouteValuesAddressScheme.cs Microsoft.AspNetCore.Routing.DefaultLinkGenerator.GetEndpoints@RenderTitleSegments(pageTitle)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable