A free open source IT asset/license management system
ok, this kind of works - pr needs some clean up
slong753691faf6340d6
diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.phpindex c291a7fad0..67bb3a8076 100644--- a/app/Http/Controllers/Assets/BulkAssetsController.php+++ b/app/Http/Controllers/Assets/BulkAssetsController.php@@ -253,23 +253,29 @@ class BulkAssetsController extends ControllerAsset::find($assetId)->update($this->update_array);}} // endforeach ($assets)- ray($error_bag);+ ray(['error_bag1' => $error_bag]);if(!empty($error_bag)) {// $errors = collect($error_bag)->unique();// foreach ($errors as $key => $value) {// ray($value->message);// }$errors = [];- foreach ($error_bag as $key => $value) {- foreach($value as $key => $value) {- $errors[] = $value;+ //find the customfield name from the name of the messagebag items+ foreach ($error_bag as $key => $bag) {+ ray($bag->keys());+ foreach($bag->keys() as $key => $value) {+ CustomField::where('db_column', $value)->get()->map(function($item) use (&$errors) {+ $errors[] = $item->name;+ });}- }- ray($error_bag);- Session::save('ids', $assets);+ }+ ray(['error_bag2' => $errors]);++ // Session::save('ids', $assets);+// return redirect()->route('hardware/bulkedit');- return redirect()->back()->with('bulk_errors', $errors);+ return redirect($bulk_back_url)->with('bulk_errors', array_unique($errors));}return redirect($bulk_back_url)->with('success', trans('admin/hardware/message.update.success'));}diff --git a/resources/views/notifications.blade.php b/resources/views/notifications.blade.phpindex 26f432c3d9..b0630f8583 100755--- a/resources/views/notifications.blade.php+++ b/resources/views/notifications.blade.php@@ -115,19 +115,19 @@@endif-{{-- @if ($messages = Session::get('bulk_errors'))+@if ($messages = Session::get('bulk_errors'))<div class="col-md-12"><div class="alert alert alert-danger fade in"><button type="button" class="close" data-dismiss="alert">×</button><i class="fas fa-exclamation-triangle faa-pulse animated"></i><strong>{{ trans('general.notification_error') }} </strong>The following fields had validation errors and were not edited:- @foreach($messages as $message => $value)- <br> {{ $value. }}+ @foreach($messages as $message)+ <br> {{ $message }}@endforeach</div></div>-@endif --}}+@endif@if ($message = Session::get('warning'))