Open orchardbot opened 12 years ago
@bleroy commented:
I think the bug is that when more than one alias exists for a given content, the one that is persisted with the item does not necessarily win when generating URL from standard MVC API.
@IvanFeric commented:
Exactly that!
If content item was created with AutoRoute URL, and afterwards decides to change that URL to another, custom URL, the URL that is displayed throughout the front end is the first, automatically generated URL instead of the custom one.
ermakovich commented:
I will appreciate, if you include this fix in 1.4.1. For me impact of this issue is really high...
@bleroy commented:
Can you explain why impact is high?
ermakovich commented:
From my perspective, it would be nice, if old aliases would be used for backward compatibility only, and when client navigates to it, Orchard would automatically redirect him to the most relevant alias.
cwoodhouse commented:
yeah, basically when using autoroute, if you allow the default route to be overridden in the editor and someone overrides then the frontend url generated by Url.ItemDisplayUrl doesn't always use that alias, it uses the old one rather then the latest.
@sebastienros commented:
Postponed to later version.
After some investigation, an AliasRoute is created for each of the available aliases. When GetItemDisplayUrl is called, the RouteValues are something like Contents/Display/Id, which then can be resolved by several alias. It results that several alias routes do match this one, thus, several possible paths. There is currently no implemented way to make a specific alias have a higher priority than the others.
@IvanFeric created: https://orchard.codeplex.com/workitem/18575
Could Url.ItemDisplayUrl be modified so that it returns custom AutoRoute URL that users entered if it exists and not the defaultly generated AutoRoute URL as it does now?