Hiim 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 404we 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?
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.
Thanks Quani 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? regardsPawel