Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Mar 7, 2024
2 parents 55c2379 + c66267a commit ea2d54b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/Http/Controllers/Assets/BulkAssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Session;
use App\Http\Requests\AssetCheckoutRequest;
use App\Models\CustomField;
Expand Down Expand Up @@ -95,6 +96,11 @@ public function edit(Request $request)

$assets = $assets->get();

if ($assets->isEmpty()) {
Log::debug('No assets were found for the provided IDs', ['ids' => $asset_ids]);
return redirect()->back()->with('error', trans('admin/hardware/message.update.assets_do_not_exist_or_are_invalid'));
}

$models = $assets->unique('model_id');
$modelNames = [];
foreach($models as $model) {
Expand Down
2 changes: 1 addition & 1 deletion app/View/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function render(callable $callback = null)
$template = LabelModel::find($settings->label2_template);

// If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) {
if ((!$settings->label2_enable)) {
return view('hardware/labels')
->with('assets', $assets)
->with('settings', $settings)
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-US/admin/hardware/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'success' => 'Asset updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
'no_assets_selected' => 'No assets were selected, so nothing was updated.',
'assets_do_not_exist_or_are_invalid' => 'Selected assets cannot be updated.',
],

'restore' => [
Expand Down

0 comments on commit ea2d54b

Please sign in to comment.