November Happy Hour will be moved to Thursday December 5th.

error in cms when using CatalogRouteHelper.MapDefaultHierarchialRouter(routes, true)

Vote:
 

Hi

im having a problem with publishing pages in CMS when using CatalogRouteHelper.MapDefaultHierarchialRouter(routes, true) but all the catalogues works just fine and all the porducts/variants works good with routing using this setting. but i cant publish anything in cms.. 

well only on the first level, publishing and changing in the lower levels works just fine..

Error im getting:

"NetworkError: 500 Internal Server Error - http://localhost/manage/cms/Stores/contentdata/4888_7791"

we previously used the below setting which working fine but only for the items in the first catalogue.. items in the other catalogues just generates 404
we have rootcatalogue and 5 subcatalogues, the products and the variants in the first one works fine but in the other generates 404... 

var contentLoader = ServiceLocator.Current.GetInstance();
var referenceConverter = ServiceLocator.Current.GetInstance();
var languageSelectionFactory = ServiceLocator.Current.GetInstance();
var routingSegmentLoader = ServiceLocator.Current.GetInstance();
var catalog = contentLoader.GetChildren(referenceConverter.GetRootLink()).FirstOrDefault();

RouteTable.Routes.RegisterPartialRouter(new HierarchicalCatalogPartialRouter(() => SiteDefinition.Current.StartPage, catalog, true, contentLoader, languageSelectionFactory, routingSegmentLoader));

anyone have any idea what could be wrong here :S?

#121301
May 06, 2015 13:40
Vote:
 

Hi,

Without the stacktrace it's very hard to know what wrong, but I would suggest to check the RouteSegment for catalogs. You can check them in CatalogLanguage table in Commerce database. They should not be null.

Regards.

/Q

#121420
May 10, 2015 19:02
Vote:
 

Thanks Quan

i recieved a script doing just that

update [dbo].[CatalogLanguage]
set urisegment = replace(c.Name, ' ', '_')
from [dbo].[Catalog] c
where [CatalogLanguage].CatalogId = c.CatalogId
and UriSegment is null



there was some validations added in the latest versions of episerver commerce so this stopped to work because of the null values.. 


Maybe this script should be added to the database updatde scripts that we have to run after upgrades? 

regards
Pawel

#121441
May 11, 2015 13:21
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.