From a1c7e4c73ac05a3373a851478906d4e0b584c66f Mon Sep 17 00:00:00 2001 From: jitendra Date: Wed, 19 Dec 2018 16:42:29 +0530 Subject: [PATCH] Mass attribute deletion issue fixed --- .../Attribute/src/Http/Controllers/AttributeController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php b/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php index a2b7e7378..452522dc1 100644 --- a/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php +++ b/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php @@ -156,11 +156,13 @@ class AttributeController extends Controller $indexes = explode(',', request()->input('indexes')); foreach($indexes as $key => $value) { + $attribute = $this->attribute->findOrFail($value); + try { if(!$attribute->is_user_defined) continue; else - $this->attribute->delete($id); + $this->attribute->delete($value); } catch(\Exception $e) { $suppressFlash = true; @@ -169,7 +171,7 @@ class AttributeController extends Controller } if(!$suppressFlash) - session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success')); + session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success', ['resource' => 'attributes'])); else session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'attributes']));