stepanbenes / api-for-nopcommerce

API plugin for nopCommerce 4.50
MIT License
139 stars 91 forks source link

create or update category not effect to the UrlRecord Table #44

Closed yamanbas closed 2 years ago

yamanbas commented 3 years ago

After create or update categories the menu links are not working because of the UrlRecord table is not updated. Need to open category and save by the admin page of nopcommerce.

stepanbenes commented 3 years ago

Good catch. Thanks. I did not know about the UrlRecord. However, is this desirable behavior? Wouldn't make sense to update UrlRecord using api instead?

yamanbas commented 3 years ago

actually UrlRecord is been update by create or update products. but no with create or update Categories. If a category insert by nopApiClient.CreateCategory it can show at page but dysfunctional. UrlRecord can be update by sql as "insert into UrlRecord (EntityName,Slug,EntityId,IsActive,LanguageId) select 'Category',Name,Id,1,0 from Category" After this restart required. also it may be update with Nop.Services.Seo.IUrlRecordService.cs functions as described here (I didn't check) : https://www.nopcommerce.com/en/boards/topic/27541/urlrecord-when-deleting-cateory-or-product I will try to debug and fix plugin later

stepanbenes commented 3 years ago

@yamanbas Thank you!

yamanbas commented 2 years ago

Hi, when I checked I saw that it's related to the SeName property of the CategoryDto If it's not null UrlRecord table is updating and by the way Categories are work