Bug 1610685 - Service Dialog CheckBox has null value when not ticked by default
Summary: Service Dialog CheckBox has null value when not ticked by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.9.3
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.9.4
Assignee: drew uhlmann
QA Contact: Shveta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-01 08:20 UTC by Nikhil Gupta
Modified: 2018-10-02 07:38 UTC (History)
8 users (show)

Fixed In Version: 5.9.4.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 18:01:40 UTC
Category: ---
Cloudforms Team: ---


Attachments (Terms of Use)
unrelated API issue -- payload without checkbox (10.00 KB, image/png)
2018-08-22 12:32 UTC, drew uhlmann
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2561 None None None 2018-09-04 18:02:39 UTC
Red Hat Knowledge Base (Solution) 3635361 None None None 2018-10-02 07:38:20 UTC

Description Nikhil Gupta 2018-08-01 08:20:34 UTC
Description of problem:
Service Dialog CheckBox has null value when not ticked by default.
- When I directly order a service without touching the checkbox, the value is blank or null:
~~~
[----] I, [2018-08-01T01:59:27.627205 #1322:12b24a0]  INFO -- : <AEMethod groupsequencecheck> 	dialog_check_box_1: 
[----] I, [2018-08-01T01:59:31.161251 #1322:100570c]  INFO -- : <AEMethod dialog_parser> dialog_options: {"dialog_check_box_1"=>"", "dialog_textarea_box_1"=>"", "request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>99000000000045}
[----] I, [2018-08-01T01:59:36.382484 #1322:1024e18]  INFO -- : <AEMethod dialog_parser> dialog_options: {"dialog_check_box_1"=>"", "dialog_textarea_box_1"=>"", "request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>99000000000045}
[----] I, [2018-08-01T01:59:47.818039 #1322:132269c]  INFO -- : <AEMethod provision> 	dialog_check_box_1: 
[----] I, [2018-08-01T01:59:50.356531 #1322:1337308]  INFO -- : <AEMethod check_provisioned> 	dialog_check_box_1: 
~~~

- When I tick and untick the checkbox, the value sets as "f":
~~~
[----] I, [2018-08-01T01:57:27.166002 #1322:121af4c]  INFO -- : <AEMethod groupsequencecheck> 	dialog_check_box_1: f
[----] I, [2018-08-01T01:57:30.622854 #1322:100570c]  INFO -- : <AEMethod dialog_parser> dialog_options: {"dialog_check_box_1"=>"f", "dialog_textarea_box_1"=>"", "request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>99000000000044}
[----] I, [2018-08-01T01:57:30.625480 #1322:100570c]  INFO -- : <AEMethod dialog_parser> Adding seq_id: 0 key: dialog_check_box_1 value: f 
[----] I, [2018-08-01T01:57:30.685579 #1322:100570c]  INFO -- : <AEMethod dialog_parser> parsed_dialog_options: "---\n0:\n  :check_box_1: f\n  :dialog_check_box_1: f\n"
[----] I, [2018-08-01T01:57:34.440244 #1322:10056a8]  INFO -- : <AEMethod catalogiteminitialization> merged_options_hash: {:check_box_1=>"f", :dialog_check_box_1=>"f"}
[----] I, [2018-08-01T01:57:34.566287 #1322:10056a8]  INFO -- : <AEMethod catalogiteminitialization> Adding Option: {dialog_check_box_1 => f} to Destination id: 99000000000044
[----] I, [2018-08-01T01:57:44.259913 #1322:1255fd4]  INFO -- : <AEMethod provision> 	dialog_check_box_1: f
[----] I, [2018-08-01T01:57:46.803777 #1322:125e990]  INFO -- : <AEMethod check_provisioned> 	dialog_check_box_1: f
~~~

Version-Release number of selected component (if applicable):
cfme-5.9.3.4-1.el7cf.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create Service Dialog with the following elements
    - Checkbox ( not ticked)
    - Dynamic Text Area 
        use the following code for the dynamic text area
        #####################
        check_box  =  $evm.root['dialog_check_box_1']
        puts "#{check_box}"
        ###################
   In the Checkbox element, add refresh field to "Text Area"

2. Create a Service catalog Item and use the newly created Service Dialog

3. Order the Service catalog item

4. Check automation.log 

Actual results:
The default value is blank or null.

Expected results:
We expect that during the initial Service dialog load, by default, the value of the checkbox will be "f".

Additional info:
- Ticking the Checkbox will shows the value of "t", then untick will now have the value of "f".

Comment 3 drew uhlmann 2018-08-01 17:41:22 UTC
@Nikhil, could you please tell me if this is a regression?

Comment 5 drew uhlmann 2018-08-02 20:14:14 UTC
This works on master, and it also works if you set the field to have a default value of false.

Comment 6 drew uhlmann 2018-08-02 21:47:42 UTC
@Nikhil! Sorry about this, but could you please retest this on your appliance? I have a one line change made on that system in app/models/dialog_field_check_box.rb.

Comment 8 drew uhlmann 2018-08-07 14:14:07 UTC
https://github.com/ManageIQ/manageiq/pull/17810

Comment 10 Shveta 2018-08-21 20:37:32 UTC
I am seeing 

====================
 <AEMethod dialog_parser> dialog_options: {"dialog_check_box_1"=>nil, "dialog_textarea_box_1"=>"", "request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>6}
=========================

When the checkbox is not set to any value . 
It shows "nil "
Is it supposed to show 'f' as stated in the issue ?

Appliance : https://10.8.199.142
Service : catalog_item

Comment 11 drew uhlmann 2018-08-22 11:57:37 UTC
Hey Shveta. So the original bug for which this ticket was filed was about the backend code not setting the value correctly. The issue I'm seeing on your appliance is a different issue. I verified originally that the API payload had the right value -- f, just like you mentioned -- but on your appliance for some reason, the API isn't showing the same thing. Since Nikhil confirmed that my fix worked for the issue he was seeing, can you please verify this ticket and reopen a similar ticket on the API? You can assign that ticket to me, that's fine, but I'd like to be very clear that these are separate issues.

Comment 12 drew uhlmann 2018-08-22 12:30:39 UTC
Looking into the API issue further, I think you'll find that if you try to submit the dialog without changing the checkbox at all, the API payload doesn't even list the checkbox as a field.

Comment 13 drew uhlmann 2018-08-22 12:32:03 UTC
Created attachment 1477871 [details]
unrelated API issue -- payload without checkbox

Comment 14 Shveta 2018-08-22 16:44:28 UTC
Verifying based on above comment and opening new BZ for API issue 
https://bugzilla.redhat.com/show_bug.cgi?id=1620208

Comment 16 errata-xmlrpc 2018-09-04 18:01:40 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-2018:2561


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