mirror of
https://github.com/snipe/snipe-it.git
synced 2026-08-18 11:15:42 +00:00
Fixed #19452 - allow null reponsible party in maintenances
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user