Bug 1240309 - Javascript error on refresh of dynamic drop down with nil key
Summary: Javascript error on refresh of dynamic drop down with nil key
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.5.0
Assignee: eclarizi
QA Contact: Jeff Teehan
URL:
Whiteboard:
: 1266838 (view as bug list)
Depends On: 1271104 1298968
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-06 14:13 UTC by Carsten Clasohm
Modified: 2016-01-15 14:44 UTC (History)
8 users (show)

Fixed In Version: 5.5.0.5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-04 16:54:19 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2551 0 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 17:58:09 UTC

Description Carsten Clasohm 2015-07-06 14:13:01 UTC
Description of problem:

We have some custom automation methods to populate dynamic drop down lists in service dialogs. These worked in CloudForms 3.1.

When used with CloudForms 3.2, pressing the Refresh button next to the drop down list brings up the spinning "wait" wheel and nothing else happens. Opening the browser's Javascript console, we see a Javascript error.


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

cfme-5.4.0.5-1.el6cf.x86_64
google-chrome-stable-43.0.2357.130-1.x86_64
firefox-38.0.5-2.fc22.x86_64


How reproducible:

always


Steps to Reproduce:
1. Create an automation methods that returns a hash like {nil=>"< none >", 1000000000089=>"test1"}
2. Create a service dialog with a dynamic drop down that uses this automation method.
3. Create a service catalog item that uses this dialog.
4. Open the provisioning form for the catalog item and press the Refresh button next to the form field.

Actual results:

The browser's Javascript console shows this error:

Uncaught TypeError: Cannot read property 'toString' of null
(anonymous function)	@	VM360:15
J.extend.each	@	application-7cf77a7923fd5440859a58020e1961fa.js:23
(anonymous function)	@	VM360:12
d	@	application-7cf77a7923fd5440859a58020e1961fa.js:23
u.fireWith	@	application-7cf77a7923fd5440859a58020e1961fa.js:23
n	@	application-7cf77a7923fd5440859a58020e1961fa.js:31
n	@	application-7cf77a7923fd5440859a58020e1961fa.js:31

Similar error in Firefox (also on line 23 of application.js):

TypeError: value[0] is null


Expected results:

Refreshing the dynamic field should work.


Additional info:

As a workaround, we changed our automation code to use '' instead of nil for the first hash entry, like this:

{''=>"< none >", 1000000000089=>"test1"}

That seems to mostly work, except that we now run into https://bugzilla.redhat.com/show_bug.cgi?id=1219950 when we change the selection in the drop down to "test1" and then change it back to "< none >".

Comment 2 Greg McCullough 2015-07-06 15:45:47 UTC
Erik - I think you already resolved this issue.  Please confirm.

Comment 3 eclarizi 2015-07-07 15:09:02 UTC
Greg - Yes, this has been resolved on the latest downstream 5.4.z. It was fixed with this MR, I believe: http://gitlab.cloudforms.lab.eng.rdu2.redhat.com/cloudforms/cfme/merge_requests/149

Comment 4 eclarizi 2015-09-28 20:19:46 UTC
*** Bug 1266838 has been marked as a duplicate of this bug. ***

Comment 5 eclarizi 2015-09-28 20:20:49 UTC
Discovered via #1266838 that the fix for this would not currently pass validation so pulling it back into ON_DEV.

Comment 6 CFME Bot 2015-09-30 17:40:23 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/50a38f222b59004401b61bb54094a035c22abe2d

commit 50a38f222b59004401b61bb54094a035c22abe2d
Author:     Erik Clarizio <eclarizi>
AuthorDate: Tue Sep 29 07:27:51 2015 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Tue Sep 29 07:27:51 2015 -0700

    Refactor and add test for dialog_field_refresh.js
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1240309
    
    Note that tests fail on purpose for this commit to verify the bug.

 app/assets/javascripts/dialog_field_refresh.js | 42 ++++++++++--------
 spec/javascripts/dialog_field_refresh_spec.js  | 60 ++++++++++++++++++++++++++
 spec/javascripts/helpers/SpecHelper.js         |  1 +
 3 files changed, 84 insertions(+), 19 deletions(-)
 create mode 100644 spec/javascripts/dialog_field_refresh_spec.js

Comment 7 CFME Bot 2015-09-30 17:40:29 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/827a34d64c46ea1bf8d8b48f827f960716e33059

commit 827a34d64c46ea1bf8d8b48f827f960716e33059
Author:     Erik Clarizio <eclarizi>
AuthorDate: Tue Sep 29 07:28:49 2015 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Tue Sep 29 07:28:49 2015 -0700

    Fix issue when refreshed values contains a null key
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1240309

 app/assets/javascripts/dialog_field_refresh.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comment 8 Jeff Teehan 2015-12-04 16:54:19 UTC
Per Dave Johnson, closing this out for now, we will make sure a test case is in place and verify once the blocker is fixed.


Note You need to log in before you can comment on or make changes to this bug.