From 7dd32d2f3b8c0ec22ebe4ffe9fb940ce2a60fa92 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Mon, 2 Dec 2019 09:34:19 +0300 Subject: [PATCH] #162 update gives an error --- .../src/Http/Controller/Admin/CategoryController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php b/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php index 671275bac..a0c4ebef5 100644 --- a/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php +++ b/addons/default/visiosoft/cats-module/src/Http/Controller/Admin/CategoryController.php @@ -111,7 +111,7 @@ class CategoryController extends AdminController if (empty($isMultiCat)) { $this->categoryRepository->create(array_merge($translatableEntries, [ 'slug' => $all['slug'], - 'parent_category' => $all['parent_category'], + 'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'], 'icon' => $all['icon'], 'seo_keyword' => $all['seo_keyword'], 'seo_description' => $all['seo_description'], @@ -123,7 +123,7 @@ class CategoryController extends AdminController } $this->categoryRepository->create(array_merge($translatableEntries, [ 'slug' => $this->str->slug(reset($translatableEntries)['name'], '_'), - 'parent_category' => $all['parent_category'], + 'parent_category' => $all['parent_category'] === "" ? null : $all['parent_category'], 'icon' => $all['icon'], 'seo_keyword' => $all['seo_keyword'], 'seo_description' => $all['seo_description'],