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".
@Nikhil, could you please tell me if this is a regression?
This works on master, and it also works if you set the field to have a default value of false.
@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.
https://github.com/ManageIQ/manageiq/pull/17810
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
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.
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.
Created attachment 1477871 [details] unrelated API issue -- payload without checkbox
Verifying based on above comment and opening new BZ for API issue https://bugzilla.redhat.com/show_bug.cgi?id=1620208
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