Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Issue adding category from code with same segment name

Vote:
 

In my project there are two sites and each uses its own catalog. Category with same name can be in both catalog. When I am trying to add Category with IContentRepository it is giving me exception that Category with same Url name already exists. I found that there is flag named 
 episerver:commerce.UseLessStrictEntryUriSegmentValidation" that I can turn on in App.Settings, but I am getting same exception. Am I doing something wrong? 

Thanks, 

Sudip

#208187
Oct 17, 2019 0:00
Vote:
 

Hi, while reading this blog post, I realize that this validation only happens on publishing and as you are adding that via code that may not work.

#208192
Oct 17, 2019 10:29
Vote:
 

That setting affects at code level, but as the name might suggest, it only affects the entries, not the categories. I will look into that to see if we can lift the restriction, but that'll take time.

#208193
Oct 17, 2019 10:35
Vote:
 

When I looked more into this, we have allowed this since Commerce 10.4, for example in Quicksilver I can do this

Note that both categories have mens-shoes as uri segment.

#208466
Oct 24, 2019 14:38
Vote:
 

Perhaps that you have custom implementation of HierarchicalCatalogPartialRouter ? 

#208467
Oct 24, 2019 14:57
Vote:
 

For future visitors, there was a bugfix in 13.29 (COM-10258) which allows you to have two categories in two different parent categories with same uri-segment

#286182
Edited, Aug 26, 2022 13:39
* 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.