diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index ded29bc735..89ed27e8be 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -42,6 +42,9 @@ class BulkAssetsController extends Controller { $this->authorize('view', Asset::class); + /** + * No asset IDs were passed + */ if (! $request->filled('ids')) { return redirect()->back()->with('error', trans('admin/hardware/message.update.no_assets_selected')); } @@ -50,6 +53,7 @@ class BulkAssetsController extends Controller $bulk_back_url = request()->headers->get('referer'); session(['bulk_back_url' => $bulk_back_url]); + $asset_ids = $request->input('ids'); $assets = Asset::with('assignedTo', 'location', 'model')->find($asset_ids); @@ -92,9 +96,9 @@ class BulkAssetsController extends Controller return view('hardware/bulk') ->with('assets', $asset_ids) + ->with('statuslabel_list', Helper::statusLabelList()) ->with('models', $models->pluck(['model'])) - ->with('modelNames', $modelNames) - ->with('statuslabel_list', Helper::statusLabelList()); + ->with('modelNames', $modelNames); } }