From fad9061ce9b4fc1da3ad5bf5f33616c9c4689079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=A4rter?= Date: Thu, 9 Feb 2023 22:04:52 +0100 Subject: [PATCH] Issue #2016: Replace hardcoded id with call to StateTypeLookup. --- Kernel/Modules/AdminState.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Kernel/Modules/AdminState.pm b/Kernel/Modules/AdminState.pm index d18d354fc..e1f9f656d 100644 --- a/Kernel/Modules/AdminState.pm +++ b/Kernel/Modules/AdminState.pm @@ -352,11 +352,16 @@ sub _Edit { SelectedID => $Param{ValidID} || $ValidListReverse{valid}, Class => 'Modernize Validate_Required ' . ( $Param{Errors}->{'ValidIDInvalid'} || '' ), ); + + my $SelectedStateID = $StateObject->StateLookup( + StateType => 'pending reminder', + ) || ''; + # default selected state type is 'pending reminder' $Param{StateTypeOption} = $LayoutObject->BuildSelection( Data => { $StateObject->StateTypeList( UserID => 1 ), }, Name => 'TypeID', - SelectedID => $Param{TypeID} || 4, + SelectedID => $Param{TypeID} || $SelectedStateID, Class => 'Modernize Validate_Required ' . ( $Param{Errors}->{'TypeIDInvalid'} || '' ), ); $LayoutObject->Block(