Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2016: Set default selected state type to pending reminder #2017

Open
wants to merge 2 commits into
base: rel-11_0
Choose a base branch
from

Conversation

stefanhaerter
Copy link
Contributor

@stefanhaerter stefanhaerter commented Nov 18, 2022

Closing #2016

@stefanhaerter stefanhaerter added the enhancement New feature or request label Nov 18, 2022
@stefanhaerter stefanhaerter requested a review from svenoe November 18, 2022 13:47
Copy link
Contributor

@bschmalhofer bschmalhofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, magic number like 4 should be avoided, but I don't really have a better idea. Approving as the magic number is at least documented in a code comment.

@stefanhaerter
Copy link
Contributor Author

I had the same thought. Only alternative I'm aware of would be to use Selected => 'pending reminder', but I would prefer the id over the name, and as @StefanAbel-OTOBO indicated here, there is no known sane way to delete the state type, so I hope this is an acceptable option.

$Param{StateTypeOption} = $LayoutObject->BuildSelection(
Data => { $StateObject->StateTypeList( UserID => 1 ), },
Name => 'TypeID',
SelectedID => $Param{TypeID},
SelectedID => $Param{TypeID} || 4,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Kernel::System::State->StateTypeLookup() for 'pending reminder' and just set the default ID, if an ID is found.

@stefanhaerter stefanhaerter force-pushed the issue-#2016-default-state-type branch from 2660cd6 to 9398871 Compare October 19, 2023 16:44
@stefanhaerter stefanhaerter changed the base branch from rel-10_1 to rel-11_0 October 19, 2023 16:45
@stefanhaerter stefanhaerter force-pushed the issue-#2016-default-state-type branch from 9398871 to b6561b4 Compare January 26, 2024 12:23
@stefanhaerter stefanhaerter force-pushed the issue-#2016-default-state-type branch from b6561b4 to fad9061 Compare February 6, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants