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

18.0 fix select type on ticket list #32120

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from

Conversation

thomas-Ngr
Copy link
Contributor

@thomas-Ngr thomas-Ngr commented Nov 27, 2024

FIX Select type in ticket list

see issue #31619 (issue mentions 20.0 ; I confirm on 18.0 and develop)

We have a problem on ticket type selection :

  • on creation form, default value should be set and empty value should be forbidden.
  • on ticket list search field, default value should not be set and empty value should be allowed.

The function selectTypesTickets deals with many cases when $selected is empty :

  • the field can be empty, and we don't want to select the default value (this is the case in ticket list search field, which is a multiselect)
  • the field can be empty, and we want to select the default value (theoritical case, I will not deal with it)
  • the field should not be empty, and we want to select the default value (this is the case in ticket creation card)
  • the field should not be empty, and there is no default value (this may be the case in ticket creation card) -> this means the select will be selected on the first entry. The function should display an entry that is obviously wrong, like 'Please select type.'

To illustrate the problem on ticket list search field, when I load ticket/list.php (or do a search without setting the field for ticket type), the search field for type is set to default by DLB :

image

This means that I have to remove this field each time I do a new search.

This PR :

  • modifies selectTypesTickets to match these requirements
  • changes the call to selectTypesTickets in creation form to forbid empty value.

As a consequence :

  • on ticket list, the search field for type remains empty
  • on creation card, the default value is selected
  • on creation card, if there is no default value, the value '-- Select type --' is the first of the list and is used.
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant