Bug 1312049

Summary: <Choose> Won't Display on Refresh of Dynamic Dropdown
Product: Red Hat CloudForms Management Engine Reporter: Chris Pelland <cpelland>
Component: UI - OPSAssignee: Martin Hradil <mhradil>
Status: CLOSED ERRATA QA Contact: luke couzens <lcouzens>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.5.0CC: cpelland, dajohnso, duboyd, hkataria, jhardy, jprause, mfeifer, mhradil, mpovolny, obarenbo
Target Milestone: GAKeywords: ZStream
Target Release: 5.5.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.3.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1311308 Environment:
Last Closed: 2016-04-13 18:45:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1311308    
Bug Blocks:    

Comment 4 luke couzens 2016-04-01 10:13:23 UTC
Hi Martin, 

can I have some more info on creating this bug. I have followed the steps the best I can but can't even reproduce this on a 5.5.2.4 appliance.

Thanks,

Luke

Comment 5 Martin Hradil 2016-04-01 11:33:02 UTC
Hi Luke..

I'm not sure how to reproduce *exactly*, you would need some automate method generating data for that.. (and I no longer have the method).


However, given the issue is really about bad escaping of the sent values in JS, you can do this:

* create a service dialog with a dynamic dropdown, enable both autorefresh and the refresh button
* assign that dialog to a button, for example on VMs & Templates
* trigger that button in a toolbar
* you should see <None> in the select
* click the Refresh button

.. in 5.5.2.4, you will see "Nothing selected" in the dropdown, even though the server response (from dynamic_radio_button_refresh) includes `refreshed_values: [[null, "<None>"]]`

.. in 5.5.3.2, the server response will be the same, but you should keep seeing "<None>" in the dropdown (becasue those angle brackets are now escaped correctly and don't break the select).

Comment 6 luke couzens 2016-04-01 16:14:37 UTC
Verified in 5.5.3.2 using this code for the automate method: 

dialog_field = $evm.object

# sort_by: value / description / none
dialog_field["sort_by"] = "value"

# sort_order: ascending / descending
dialog_field["sort_order"] = "ascending"

# data_type: string / integer
dialog_field["data_type"] = "integer"

# required: true / false
dialog_field["required"] = "true"

dialog_field["values"] = {nil => "<Choose>", 1 => "one", 2 => "two", 10 => "ten", 50 => "fifty"}
dialog_field["default_value"] = "<Choose>"

the choose value shows on 5.5.3.2 but not on 5.5.2.4

Comment 8 errata-xmlrpc 2016-04-13 18:45:22 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/RHBA-2016:0616