Description of problem: When using dynamic multi select dialog elements the first element is always selected even if nil default is specified and it does not show up as selected in UI Version-Release number of selected component (if applicable): 5.9.2.4.20180501195858_35dc609 How reproducible: Always Steps to Reproduce: 1. Create a multi select dynamic drop down and have the automate method set the `default_value` to nil 2. Open the service catalog item Actual results: The dialog element displays correctly with no elements selected but if you look at the logs or submit you will find that the first element is selected. This is doubly bad because the first element is selected even though the UI does not show it as selected and there seems to be no way to select no default which is a regression from 5.8. Expected results: Should be able to set the default value to nil and have no items selected by default. Additional info: Worked around this by adding a bogos entry of { nil => "<Choose>" } but even that option won't be selected when the default option is set to nil and so it just becomes another item in the drop down cluttering the UI.
I have worked on this with Erik Clarizio and discovered a few things. The backend seems to be changing the data type for the return of defaults in a multiselect scenario. It converts an array over to a string and it is confusing the frontend. Erik has offered to take a look at this issue to fix the backend.
https://github.com/ManageIQ/manageiq/pull/17449
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/b73e8f6613be622a6f190b241b8904981facf0a9 commit b73e8f6613be622a6f190b241b8904981facf0a9 Author: Erik Clarizio <eclarizi> AuthorDate: Mon May 21 01:01:39 2018 -0400 Commit: Erik Clarizio <eclarizi> CommitDate: Mon May 21 01:01:39 2018 -0400 Adjust how default_value is calculated for multi-value drop downs https://bugzilla.redhat.com/show_bug.cgi?id=1576288 app/models/dialog_field_drop_down_list.rb | 22 + app/models/dialog_field_sorted_item.rb | 3 - spec/models/dialog_field_drop_down_list_spec.rb | 56 +- spec/models/dialog_field_sorted_item_spec.rb | 23 - 4 files changed, 76 insertions(+), 28 deletions(-)
Verified in Version 5.10.0.21.20181023151612_4c11b0d