3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 02:45:39 +00:00

Derp. Use correct model info

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-04-08 04:07:31 +01:00
parent e95d7076b9
commit b51939ae76

View File

@ -11,12 +11,10 @@ trait MayContainCustomFields
public function withValidator($validator)
{
// In case the model is being changed via form
if (request()->has('model_id')!='') {
// For auditing and some other non-standard things where $this is only the form submission and may not have the asset info
// In case the model is being changed
if (request()->input('model_id')!='') {
$asset_model = AssetModel::find(request()->route('asset')->model_id);
$asset_model = AssetModel::find(request()->input('model_id'));
// or if we have it available to route-model-binding
} elseif ((request()->route('asset') && (request()->route('asset')->model_id))) {