Skip to content

A free open source IT asset/license management system

Fixed #19452 - allow null reponsible party in maintenances

sniped307959ada00
diff --git a/app/Http/Controllers/MaintenancesController.php b/app/Http/Controllers/MaintenancesController.php
index 8b9a0851a1..172a900183 100644
--- a/app/Http/Controllers/MaintenancesController.php
+++ b/app/Http/Controllers/MaintenancesController.php
@@ -105,7 +105,13 @@ class MaintenancesController extends Controller
$maintenance->name = $request->input('name');
$maintenance->start_date = $request->input('start_date');
$maintenance->expected_completion_date = $request->input('expected_completion_date', $request->input('completion_date'));
- $maintenance->responsible_party_id = $request->input('responsible_party_id') ?: auth()->id();
+ // Honor an explicit clear: an empty submission means "no
+ // responsible party," not "default to the creator." The
+ // create form pre-selects the current user as a UX default
+ // (edit.blade.php), so a submitted null here is a
+ // deliberate deselection by the user. Matches update()'s
+ // behavior. Fixes issue #19452.
+ $maintenance->responsible_party_id = $request->input('responsible_party_id');
$maintenance->created_by = auth()->id();
// Backfilled completion: user is recording a maintenance that