Bug 1746211

Summary: unexpected error when dialog with dropdownlist with integer data type is edited to multiline (forces dialog deletion)
Product: Red Hat CloudForms Management Engine Reporter: Reartes Guillermo <greartes>
Component: UI - OPSAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED ERRATA QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.8CC: bmidwood, dmetzger, hkataria, lavenel, mpovolny, mshriver, obarenbo, simaishi
Target Milestone: GAKeywords: ZStream
Target Release: 5.11.6Flags: pm-rhel: cfme-5.11.z+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 5.11.6.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-10 13:39:05 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:
Attachments:
Description Flags
Error when trying to save the dialog
none
Error after cancelling previous error and also canceling the dialog edtion
none
production.log
none
automation.log
none
evm.log (compressed due to size) none

Description Reartes Guillermo 2019-08-28 00:45:26 UTC
Description of problem:

A simple static dropdownlist dialog element on a service dialog fails when data type is integer and the dialog is edited to multiselect.
An omnious error page appears and after that, the only option is to delete the affected service dialog since CF becomes unable to edit the dialog properly and further error pages will appear.

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

How reproducible:
always

Steps to Reproduce:
1. Automation -> Automate -> Customization
2. On "All Dialogs" -> Button Configuration -> Add new dialog 
3. Dialog name "test5"
4. Add a dropdownlist to the "new section"
5. Edit the dropdownlist
6. Leave the default 1,2,3 options
7. Change value type to INTEGER, set the default to "One"
8. Also set REQUIERED to Yes.
9. Save and then Save the dialog
10. Select dialog test5 and Configuration -> edit this dialog
11. Edit the dropdownlist
12. In Options, change MULTISELECT to Yes
13. Save and then Save the dialog
14. Puff...

Actual results:

On the browser:

URL https://10.10.0.38/api/service_dialogs/1000000000019
Status 500 Internal Server Error

Content-Type application/json; charset=utf-8
Data {"error":{"kind":"internal_server_error","message":"undefined method `collect' for 1:Integer","klass":"NoMethodError"}} 

Click close, then Cancel (abort dialog edition)

Unexpected error encountered 
Error text:
undefined method `collect' for 1:Integer [miq_ae_customization/explorer] 

Now the dialog test5 cannot be edited anymore from CF. 
The only choice is to delete de dialog.

Expected results:
No error

Additional info:
No dynamic dialog elements are required to reproduce this issue.

Comment 2 Reartes Guillermo 2019-08-28 00:46:06 UTC
Created attachment 1608767 [details]
Error when trying to save the dialog

Comment 3 Reartes Guillermo 2019-08-28 00:47:05 UTC
Created attachment 1608768 [details]
Error after cancelling previous error and also canceling the dialog edtion

the dialog cannot be edited anymore.
It can only be deleted.

Comment 4 Reartes Guillermo 2019-08-28 00:47:39 UTC
Created attachment 1608769 [details]
production.log

Comment 5 Reartes Guillermo 2019-08-28 00:48:15 UTC
Created attachment 1608770 [details]
automation.log

Comment 6 Reartes Guillermo 2019-08-28 00:48:48 UTC
Created attachment 1608771 [details]
evm.log (compressed due to size)

Comment 7 Reartes Guillermo 2019-08-28 01:26:04 UTC
Additional Info:

I reproduced this with cfme-5.9.9.3-1 (CF 4.6)

Comment 8 Reartes Guillermo 2019-08-28 01:32:13 UTC
I reproduced this with cfme-5.11.0.18-1 (CF5 Beta)

Comment 15 Milan Zázrivec 2020-04-20 15:22:28 UTC
https://github.com/ManageIQ/ui-components/pull/437

Comment 16 CFME Bot 2020-04-22 17:11:39 UTC
New commit detected on ManageIQ/ui-components/master:

https://github.com/ManageIQ/ui-components/commit/c9c47999e72faa21ea2cf1b59a78408a8d9f3be8
commit c9c47999e72faa21ea2cf1b59a78408a8d9f3be8
Author:     Martin Hradil <mhradil>
AuthorDate: Tue Jan 14 23:20:29 2020 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Tue Jan 14 23:20:29 2020 +0000

    Dialog Editor - reset default_value when changing dropdown type, values, or between single and multiselect

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

    (cherry picked from commit 30797a2612b55297026c348621f0a8a2ead3ade3)

 src/dialog-editor/components/modal-field-template/modalFieldTemplateComponent.ts | 32 +-
 1 file changed, 30 insertions(+), 2 deletions(-)

Comment 17 CFME Bot 2020-05-07 17:51:35 UTC
New commit detected on ManageIQ/ui-components/ivanchuk:

https://github.com/ManageIQ/ui-components/commit/541f3e4eb5f0bd99fd920b3f4bee22c2deffb184
commit 541f3e4eb5f0bd99fd920b3f4bee22c2deffb184
Author:     Martin Hradil <mhradil>
AuthorDate: Wed Apr 22 16:00:52 2020 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Wed Apr 22 16:00:52 2020 +0000

    Merge pull request #437 from mzazrivec/bug-1746211

    Dialog Editor - reset default_value when changing dropdown type, values, or between single and multiselect

    (cherry picked from commit 2a03d66e50dabb9e9d04185fdb2b7881c1816237)

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

 .travis.yml | 2 +-
 src/dialog-editor/components/field/field.html | 1 -
 src/dialog-editor/components/field/fieldComponent.spec.ts | 24 -
 src/dialog-editor/components/field/fieldComponent.ts | 9 -
 src/dialog-editor/components/modal-field-template/modalFieldTemplateComponent.ts | 37 +-
 5 files changed, 35 insertions(+), 38 deletions(-)

Comment 18 Satoe Imaishi 2020-05-07 17:55:09 UTC
The PR is now backported to ivanchuk branch. Please release a new version of ui-components and bump the version in OpsUI/SUI.

Comment 23 errata-xmlrpc 2020-06-10 13:39:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:2480