From 90a344af0b59e7a211f2db4806fdbc34596a6d98 Mon Sep 17 00:00:00 2001 From: Tobias Franzius Date: Thu, 20 Jul 2023 13:26:42 +0200 Subject: [PATCH] Fixes #13341 Clean up correct seats on license delete Before this, we checked for the `id` collumn in the `license_seats` table, insteasd of using `license_id` for this. This way, we ensure that we only alter seats belonging to the correct license. --- app/Http/Controllers/Licenses/LicensesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Licenses/LicensesController.php b/app/Http/Controllers/Licenses/LicensesController.php index 26cba33281..02e2163207 100755 --- a/app/Http/Controllers/Licenses/LicensesController.php +++ b/app/Http/Controllers/Licenses/LicensesController.php @@ -207,7 +207,7 @@ class LicensesController extends Controller if ($license->assigned_seats_count == 0) { // Delete the license and the associated license seats DB::table('license_seats') - ->where('id', $license->id) + ->where('license_id', $license->id) ->update(['assigned_to' => null, 'asset_id' => null]); $licenseSeats = $license->licenseseats();