Bug 1559030

Summary: Saving a service dialog with a multi-select drop-down populated by expression method gives a 500 internal server error
Product: Red Hat CloudForms Management Engine Reporter: Peter McGowan <pmcgowan>
Component: UI - OPSAssignee: Roman Blanco <rblanco>
Status: CLOSED CURRENTRELEASE QA Contact: Shveta <sshveta>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, hkataria, jprause, lavenel, mkanoor, mpovolny, obarenbo, rblanco, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1568473 (view as bug list) Environment:
Last Closed: 2019-02-11 14:00:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1568473    

Description Peter McGowan 2018-03-21 14:38:34 UTC
Description of problem:
If I create a service dialog containing a drop-down list populated by an expression method, I am unable to edit the dialog to make the list multi-selectable. I can appear to make the change, but saving the dialog results in a 500 internal server error.

It looks like the change is saved because any attempt to subsequently save the same dialog gives the same 500 error.

Version-Release number of selected component (if applicable):
5.9.0.22

How reproducible:
Every time

Steps to Reproduce:
1. Create a service dialog containing a single drop-down list element. Make this element dynamic, and create an expression method to populate it (I used a simple expression method that lists all VMs). Leave the 'Multiselect' option as 'No'. Save the dialog.
2. Now edit the dialog, and change the 'Multiselect' option to 'Yes'. Save the dialog

Actual results:

A pop-up error with the text:

URL https://cloudforms/api/service_dialogs/20 

Status 500 Internal Server Error 

Content-Type application/json; charset=utf-8 

Data {"error":{"kind":"internal_server_error","message":"undefined method `collect' for 1:Fixnum","klass":"NoMethodError"}} 

Expected results:
The dialog should be saved without error.

Additional info:
Attempting to edit the dialog now results in the same 500 error. The only thing that can be done to the dialog is to delete it.

Comment 2 Greg McCullough 2018-03-21 15:29:53 UTC
Please ping Billy if you need help any help setting up the expression method.

Comment 4 Roman Blanco 2018-04-06 14:10:24 UTC
https://github.com/ManageIQ/manageiq/pull/17259

Comment 5 Roman Blanco 2018-04-10 14:19:16 UTC
new fix: https://github.com/ManageIQ/manageiq/pull/17272

Comment 7 CFME Bot 2018-04-17 14:41:42 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/aa5511decd0dd418fe48b2e412ea62aa221a0f82
commit aa5511decd0dd418fe48b2e412ea62aa221a0f82
Author:     Roman Blanco <rblanco>
AuthorDate: Tue Apr 10 09:56:56 2018 -0400
Commit:     Roman Blanco <rblanco>
CommitDate: Tue Apr 10 09:56:56 2018 -0400

    Forcing default_value to an array, if the dynamic dropdown is multiselect

    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1559030

 app/models/dialog_field_radio_button.rb | 4 +
 app/models/dialog_field_sorted_item.rb | 3 +
 2 files changed, 7 insertions(+)

Comment 9 Shveta 2018-07-13 19:56:33 UTC
Fixed in 5.10.0.3.20180705151325_ce4d2b5