Site structure
Version 7.x > Site structure > Alias collision error, even when no collisions are evident? View modes: 
User avatar
Member
Member
shauna.gordon-fahlgren - 11/20/2012 1:21:44 PM
   
Alias collision error, even when no collisions are evident?
I'm setting up my site to link to a couple of shared pages as such:

Venues
Decorations
EventType1
--Venues (links to top Venues, but shows up as EventType1/Venues)
--Decorations (links to Decorations, shows up as EventType1/Decorations)
EventType2
--Venues
--Decorations
etc

This worked well for all of the Decorations pages. I created a link item in each of the event types that linked to the top level item, and the top level item had the event types as aliases.

However, when I tried the same technique with Venues, I keep getting "Document alias is in collision with other document alias or document URL path", even though there are no other documents or aliases using the alias I'm trying to use. Additionally, this occurs even when I don't even have the link item created in a given EventType.

What could be different about this second set that would cause this to happen? Is there a better way to go about doing what I'm trying to accomplish, without duplicating all the data into separate pages?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/28/2012 2:20:40 AM
   
RE:Alias collision error, even when no collisions are evident?
Hi,

What exactly you mean by the link item? Have you checked also the document URL paths and not only the aliases?

Best regards,
Juraj Ondrus

User avatar
Member
Member
shauna.gordon-fahlgren - 11/28/2012 10:28:38 AM
   
RE:Alias collision error, even when no collisions are evident?
kentico_jurajo wrote:
What exactly you mean by the link item?


The action:
Right click a page in the CMS -> New... -> Link to existing document

creates an item in the CMS tree under the page you right clicked. That is the "link item".

That said, I figured out the issue on my own.

It turns out that when you set a custom URL that includes "{-}" in the path, and you then try to add aliases that would then match the custom URL path (IE - custom URL "site/{-}/decorations" == "site/event1/decorations"), you get the collision error.

However, one interesting thing to note, is that if you set the aliases first, then set the custom URL, the error does not occur (this is the path I had taken that did not cause an error).

So, to trigger the error:
1. On a page item (shouldn't really matter, as long as a URL maps to it), set the custom URL to something that includes the "{-}" wildcard. (for example - "site/{-}/decorations")
2. Try to add an alias to the item that would match the custom URL ("site/event1/decorations")

To have an alias that matches the custom URL, without triggering the error:
1. On a page item, leave the default URL and set up an alias ("site/event1/decorations")
2. Change the default URL to a custom URL that includes "{-}" and would match the alias ("site/{-}/decorations")

While the usefulness (or desireability) of having custom URL equal one or more alias is arguable, one of the two above behaviors appears to be not intended.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/3/2012 2:44:26 AM
   
RE:Alias collision error, even when no collisions are evident?
Hi,

Well, in both cases, only the first found alias would be used - so you cannot have two documents with the same alias anyway.
I would recommend using more exact wild cards to avoid this.

Best regards,
Juraj Ondrus

User avatar
Member
Member
shauna.gordon-fahlgren - 12/3/2012 1:12:12 PM
   
RE:Alias collision error, even when no collisions are evident?
kentico_jurajo wrote: Hi,

Well, in both cases, only the first found alias would be used - so you cannot have two documents with the same alias anyway.
I would recommend using more exact wild cards to avoid this.

Best regards,
Juraj Ondrus


That does not really address the fact that going one route allows the creation of both the wildcard URL route and matching aliases, while the other does not, but whatever.

If you have any guides on these more exact wildcards you mention, they would be greatly appreciated. As it stands, I only stumbled on this one by accident.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/3/2012 1:25:47 PM
   
RE:Alias collision error, even when no collisions are evident?
Hi,

I ahve already noticed our developers about this. The will fix it so it won't be possible to create duplicate aliases. What I meant with more exact wildcard is that the wildcard would be more exact so you won't be able to accidentally create an alias which will be the same as the resolved wildcard.

Best regards,
Juraj Ondrus

User avatar
Member
Member
shauna.gordon-fahlgren - 12/3/2012 3:25:06 PM
   
RE:Alias collision error, even when no collisions are evident?
kentico_jurajo wrote: Hi,

I ahve already noticed our developers about this. The will fix it so it won't be possible to create duplicate aliases. What I meant with more exact wildcard is that the wildcard would be more exact so you won't be able to accidentally create an alias which will be the same as the resolved wildcard.

Best regards,
Juraj Ondrus


Thanks for submitting a bug report.

Regarding the "more specific wildcards" - again, I would appreciate any guides regarding what can be used in the custom URL field. All I've found so far have been "all or nothing" kinds of solutions - you either have "sample/custom/path" or "sample/{-}/path". I've yet to find any indication that something like "sample/{custom|personal}/path" is allowed, or what the format for it would be.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/5/2012 3:59:14 AM
   
RE:Alias collision error, even when no collisions are evident?
Hi,

So, to trigger the error:
1. On a page item (shouldn't really matter, as long as a URL maps to it), set the custom URL to something that includes the "{-}" wildcard. (for example - "site/{-}/decorations")
2. Try to add an alias to the item that would match the custom URL ("site/event1/decorations")

To have an alias that matches the custom URL, without triggering the error:
1. On a page item, leave the default URL and set up an alias ("site/event1/decorations")
2. Change the default URL to a custom URL that includes "{-}" and would match the alias ("site/{-}/decorations")


It is all about the priorities.

The custom document URL path has always higher priority. So, in the first case, the document alias would be the same which makes no sense - that's why you are getting the warining. In the second case, the document URL path is set and the alias with the wildcard could be resolved in something else. In case it would be resolved in the same way as the custom URL path, the alias it not event reached since the custom URL path takes precedens and it is used - so the alias is not even hit in this case.

Best regards,
Juraj Ondrus