Skip to content

A free open source IT asset/license management system

Fixed selection store

snipe900850942513
diff --git a/app/Http/Controllers/Accessories/AccessoryCheckoutController.php b/app/Http/Controllers/Accessories/AccessoryCheckoutController.php
index 8f37c2e546..94e740123b 100644
--- a/app/Http/Controllers/Accessories/AccessoryCheckoutController.php
+++ b/app/Http/Controllers/Accessories/AccessoryCheckoutController.php
@@ -65,7 +65,11 @@ class AccessoryCheckoutController extends Controller
$this->authorize('checkout', $accessory);
$target = $this->determineCheckoutTarget();
- session()->put(['checkout_to_type' => $target]);
+ // Store the STRING kind ('user' / 'asset' / 'location'), not the
+ // model instance. The checkout-selector partial and the panel bridge
+ // both compare this against string literals — an Eloquent model in
+ // the slot silently mismatches and the "checked" radio disappears.
+ session()->put(['checkout_to_type' => request('checkout_to_type')]);
if (! $accessory->canCheckoutTo($target)) {
$targetType = match (class_basename($target)) {
diff --git a/app/Http/Controllers/Assets/AssetCheckoutController.php b/app/Http/Controllers/Assets/AssetCheckoutController.php
index 73376c66a3..378a559c1f 100644
--- a/app/Http/Controllers/Assets/AssetCheckoutController.php
+++ b/app/Http/Controllers/Assets/AssetCheckoutController.php
@@ -85,7 +85,11 @@ class AssetCheckoutController extends Controller
$admin = auth()->user();
$target = $this->determineCheckoutTarget();
- session()->put(['checkout_to_type' => $target]);
+ // Store the STRING kind ('user' / 'asset' / 'location') the
+ // operator picked, not the resolved model — the checkout-selector
+ // partial compares against string literals and an Eloquent
+ // instance in the slot silently fails every match.
+ session()->put(['checkout_to_type' => request('checkout_to_type')]);
$asset = $this->updateAssetLocation($asset, $target);
diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php
index 879c776164..991bf96016 100644
--- a/app/Http/Controllers/Assets/BulkAssetsController.php
+++ b/app/Http/Controllers/Assets/BulkAssetsController.php
@@ -672,7 +672,11 @@ class BulkAssetsController extends Controller
$admin = auth()->user();
$target = $this->determineCheckoutTarget();
- session()->put(['checkout_to_type' => $target]);
+ // Store the STRING kind ('user' / 'asset' / 'location') the
+ // operator picked, not the resolved model — the checkout-selector
+ // partial compares against string literals and an Eloquent
+ // instance in the slot silently fails every match.
+ session()->put(['checkout_to_type' => request('checkout_to_type')]);
if (! is_array($request->input('selected_assets'))) {
return redirect()->route('hardware.bulkcheckout.show')->withInput()->with('error', trans('admin/hardware/message.checkout.no_assets_selected'));