#2180 fixed
This commit is contained in:
parent
d43efc505a
commit
f47f06de31
|
|
@ -139,9 +139,9 @@ return [
|
|||
'datagrid' => [
|
||||
'mass-ops' => [
|
||||
'method-error' => 'Error! Wrong method detected, please check mass action configuration',
|
||||
'delete-success' => 'System :resource were successfully deleted',
|
||||
'delete-success' => 'Selected :resource were successfully deleted',
|
||||
'partial-action' => 'Some actions were not performed due restricted system constraints on :resource',
|
||||
'update-success' => 'System :resource were successfully updated',
|
||||
'update-success' => 'Selected :resource were successfully updated',
|
||||
'no-resource' => 'The resource provided for insufficient for the action'
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,6 @@ class AttributeController extends Controller
|
|||
public function massDestroy()
|
||||
{
|
||||
$suppressFlash = false;
|
||||
|
||||
if (request()->isMethod('post')) {
|
||||
$indexes = explode(',', request()->input('indexes'));
|
||||
|
||||
|
|
@ -161,10 +160,12 @@ class AttributeController extends Controller
|
|||
$attribute = $this->attributeRepository->find($value);
|
||||
|
||||
try {
|
||||
if (! $attribute->is_user_defined) {
|
||||
continue;
|
||||
} else {
|
||||
if ($attribute->is_user_defined) {
|
||||
$suppressFlash = true;
|
||||
$this->attributeRepository->delete($value);
|
||||
|
||||
} else {
|
||||
session()->flash('error', trans('admin::app.response.user-define-error', ['name' => 'Attribute']));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
|
@ -174,7 +175,7 @@ class AttributeController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if (! $suppressFlash)
|
||||
if ($suppressFlash)
|
||||
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']));
|
||||
|
|
|
|||
Loading…
Reference in New Issue