From 52ea172e5d6ac1b35f8d2903255b925b93bfc3ce Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 4 Oct 2021 17:18:07 -0700 Subject: [PATCH] Fix ID array Signed-off-by: snipe --- app/Http/Controllers/Assets/BulkAssetsController.php | 7 +++++-- resources/views/hardware/bulk.blade.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index 0ba9999789..e66b17792a 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -32,7 +32,8 @@ class BulkAssetsController extends Controller return redirect()->back()->with('error', 'No assets selected'); } - $asset_ids = array_keys($request->input('ids')); + + $asset_ids = array_values(array_unique($request->input('ids'))); if ($request->filled('bulk_actions')) { switch($request->input('bulk_actions')) { @@ -50,7 +51,7 @@ class BulkAssetsController extends Controller return view('hardware/bulk-delete')->with('assets', $assets); case 'edit': return view('hardware/bulk') - ->with('assets', request('ids')) + ->with('assets', $asset_ids) ->with('statuslabel_list', Helper::statusLabelList()); } } @@ -90,6 +91,8 @@ class BulkAssetsController extends Controller || ($request->filled('model_id')) ) { foreach ($assets as $assetId) { + \Log::error($assetId); + $this->update_array = []; $this->conditionallyAddItem('purchase_date') diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index f50a76ba2c..2f0e467efa 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -149,7 +149,7 @@ @foreach ($assets as $key => $value) - + @endforeach