Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Minor changes

KrzysztofPajakbe4f3893b5b6
diff --git a/src/Business/Grand.Business.Catalog/Services/Categories/CategoryService.cs b/src/Business/Grand.Business.Catalog/Services/Categories/CategoryService.cs
index 01e4597d9..b00ed0e0f 100644
--- a/src/Business/Grand.Business.Catalog/Services/Categories/CategoryService.cs
+++ b/src/Business/Grand.Business.Catalog/Services/Categories/CategoryService.cs
@@ -417,7 +417,7 @@ namespace Grand.Business.Catalog.Services.Categories
{
if (category == null)
throw new ArgumentNullException(nameof(category));
- if (String.IsNullOrEmpty(category.ParentCategoryId))
+ if (string.IsNullOrEmpty(category.ParentCategoryId))
category.ParentCategoryId = "";
//validate category hierarchy
diff --git a/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs
index e7eec4162..d55795c70 100644
--- a/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs
+++ b/src/Web/Grand.Web.Admin/Services/CategoryViewModelService.cs
@@ -202,10 +202,6 @@ namespace Grand.Web.Admin.Services
category.SeName = model.SeName;
//locales
category.Locales = await model.Locales.ToTranslationProperty(category, x => x.Name, _seoSettings, _slugService, _languageService);
- await _categoryService.UpdateCategory(category);
- //search engine name
- await _slugService.SaveSlug(category, model.SeName, "");
-
//discounts
var allDiscounts = await _discountService.GetAllDiscounts(DiscountType.AssignedToCategories, showHidden: true);
foreach (var discount in allDiscounts)
@@ -224,8 +220,12 @@ namespace Grand.Web.Admin.Services
}
}
await _categoryService.UpdateCategory(category);
+
+ //search engine name
+ await _slugService.SaveSlug(category, model.SeName, "");
+
//delete an old picture (if deleted or updated)
- if (!String.IsNullOrEmpty(prevPictureId) && prevPictureId != category.PictureId)
+ if (!string.IsNullOrEmpty(prevPictureId) && prevPictureId != category.PictureId)
{
var prevPicture = await _pictureService.GetPictureById(prevPictureId);
if (prevPicture != null)