Skip to content

Commit 906eb71

Browse files
authored
Resolve error on editing root level category
1 parent ba85bef commit 906eb71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Controllers/BinshopsCategoryAdminController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ public function update_category(UpdateBinshopsBlogCategoryRequest $request, $cat
167167
)->first();
168168
$category->fill($request->all());
169169
$translation->fill($request->all());
170+
171+
// if the parent_id is passed in as 0 it will create an error
172+
if ($category->parent_id <= 0) {
173+
$category->parent_id = null;
174+
}
175+
170176
$category->save();
171177
$translation->save();
172178

0 commit comments

Comments
 (0)