KenticoDevTrev / DynamicRouting

Dynamic Routing in Kentico using a Routing Table and Assembly Attribute
15 stars 5 forks source link

Route issues with alternative URLS #23

Closed lebster closed 4 years ago

lebster commented 4 years ago

The users accidentally set a custom slug url for a page that doesn't use a URL Pattern. This created an alternative URL that conflicts with a landing page with the same custom slug url. After resolving custom slug conflict, the user cannot resolve the alternative url conflict.

Maybe pages without URL Patterns should not add alternative URLS when modifying Url Slug? Or hide the Url Slug Properties?

Below are the steps to reproduce.

  1. Set landing page to use custom URL Slug - /Large-Group
  2. Set navigation menu item to use custom URL Slug - /Large-Group
  3. Navigate to landing page - receive expected error -

No Route Value Found No DynamicRouting assembly tag was found for the class TestMVCSite.MenuListItem, could not route page /Navigation-Menu/CARRIERS-PRODUCT/Our-Portfolio/Our-Portfolio-List/Large-Group

  1. Navigate back to Navigation Menu Item, remove custom URL Slug. Receive same error along with the following -

No Route Value Found No DynamicRouting assembly tag was found for the class TestMVCSite.MenuListItem, could not route page /Navigation-Menu/CARRIERS-PRODUCT/Our-Portfolio/Our-Portfolio-List/Large-Group

The current page's URL is in conflict with alternative URL 'Large-Group' used for the '/Header/Menu/CARRIERS + PRODUCTS/Our Portfolio/Our Portfolio/Large Group' (en-US) page. Contact your administrator or remove the alternative URL.

My current workaround is to remove the alternative url from the database, or temporarily set a URL pattern to get into alternative URL menu to remove alternative URL.

KenticoDevTrev commented 4 years ago

Acknowledged, out of curiosity did you check the dynamic routing module url slug queue? It cannot proceed if there is a conflict until resolved.

I'm experiencing a bit of a work overload so I'm having a hard time getting time to address these, any help via forking, and debugging would rock!

KenticoDevTrev commented 4 years ago

@lebster , looking at this again, actually i think the issue is less with Dynamic Routing and more how Kentico handles Alternate Urls.

When a route changes, the Dynamic Routing module automatically adds the 'old' url to the Alternative Url list. If you have 2 pages that have the same alternative url, then Kentico will give that error in the editing UI and you must resolve the conflict (delete the alternative URL).

So this is not a bug, but a natural consequence of creating a conflict of URLs. I was able to go to the Alternate Urls and remove it, please make sure that in the Settings -> URLs and SEO, that you have "Enable editing interface" checked and the mode to redirect, if they still don't have access then also make sure that they are in a role that has access to that UI element and has the Permission of "Content" -> "Manage alternative URLs (MVC).

I will be looking into why it allows conflicting custom URL slugs though, that should catch.

KenticoDevTrev commented 4 years ago

I've added a catch that won't allow you to add a Custom Url that conflicts with another custom Url on a different node (you can create matching Custom Urls on culture variations of the same node).

This will be available in the next update, along with other bug fixes.

KenticoDevTrev commented 4 years ago

This bug fixed with pushes ended on 17b89cac32fef42d9307673ebddd31b9ad519e36

lebster commented 4 years ago

Awesome, Thanks Trevor!