Merge pull request #13439 from snipe/fixes/500_error_when_cloning_invalid_accessory

Fixed route for accessory index
This commit is contained in:
snipe 2023-08-11 09:42:00 +01:00 committed by GitHub
commit a1cfa45344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,7 +131,8 @@ class AccessoriesController extends Controller
// Check if the asset exists // Check if the asset exists
if (is_null($accessory_to_clone = Accessory::find($accessoryId))) { if (is_null($accessory_to_clone = Accessory::find($accessoryId))) {
// Redirect to the asset management page // Redirect to the asset management page
return redirect()->route('accessory.index')->with('error', trans('admin/accessories/message.does_not_exist')); return redirect()->route('accessories.index')
->with('error', trans('admin/accessories/message.does_not_exist', ['id' => $accessoryId]));
} }
$accessory = clone $accessory_to_clone; $accessory = clone $accessory_to_clone;