Bug 1328226 - Multiple problems with integer type textbox dialog field
Summary: Multiple problems with integer type textbox dialog field
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.6.0
Assignee: eclarizi
QA Contact: Shveta
URL:
Whiteboard: service:dialog
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-18 18:57 UTC by Bill Wei
Modified: 2016-06-29 15:51 UTC (History)
6 users (show)

Fixed In Version: 5.6.0.6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 15:51:06 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 RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Description Bill Wei 2016-04-18 18:57:00 UTC
Description of problem:

1. When a user types an invalid number, for example "abc", the value of the field gets converted to 0 without any warning or error message. 

2. If the default value is a valid number and the user does not modify the value, the final value of the field is the default value as a string. Note the default value column in the dialog_fields table is text.

3. If the user has a valid number input, the #validate_field_data method raises an error because the value already get converted to number which does not support a regex match operation.

Note no. 3 may not be a bug but we need to find the right place to do regex validation.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 CFME Bot 2016-05-09 13:56:12 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c14696d0f354daf54fe481a520cd2e820cdac869

commit c14696d0f354daf54fe481a520cd2e820cdac869
Author:     Erik Clarizio <eclarizi>
AuthorDate: Mon May 2 13:46:07 2016 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Wed May 4 10:56:31 2016 -0700

    Add error handling to integer data type dialog text box
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1328226

 app/controllers/application_controller/dialog_runner.rb | 1 -
 app/models/dialog_field_text_box.rb                     | 8 +++++---
 spec/models/dialog_field_text_box_spec.rb               | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

Comment 4 CFME Bot 2016-05-09 13:56:15 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c55986f160b689e34b03dca3d15e917b1d670aa2

commit c55986f160b689e34b03dca3d15e917b1d670aa2
Author:     Erik Clarizio <eclarizi>
AuthorDate: Mon May 2 13:46:38 2016 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Wed May 4 10:56:31 2016 -0700

    Ensure that the value returned from #value follows the data_type
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1328226
    
    Along with this, support data_type property for dynamic text boxes

 app/models/dialog_field_text_box.rb       |  4 +--
 spec/models/dialog_field_text_box_spec.rb | 53 ++++++++++++++++++++++++++-----
 2 files changed, 47 insertions(+), 10 deletions(-)

Comment 5 CFME Bot 2016-05-09 13:56:19 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/0186bae03480c0d7949cc535d8f2061bdbfae2db

commit 0186bae03480c0d7949cc535d8f2061bdbfae2db
Author:     Erik Clarizio <eclarizi>
AuthorDate: Tue May 3 11:02:37 2016 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Wed May 4 10:56:32 2016 -0700

    Preserve nils instead of converting to 0 for integer text box
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1328226

 app/models/dialog_field_text_box.rb       |  1 +
 spec/models/dialog_field_text_box_spec.rb | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

Comment 6 CFME Bot 2016-05-09 13:56:23 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/476d60ba115e0f8750a2955d7eec2f8d680f8286

commit 476d60ba115e0f8750a2955d7eec2f8d680f8286
Author:     Erik Clarizio <eclarizi>
AuthorDate: Tue May 3 11:03:46 2016 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Wed May 4 10:56:32 2016 -0700

    Fix rubocop issue by freezing mutable object
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1328226

 app/models/dialog_field_text_box.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 7 CFME Bot 2016-05-09 13:56:27 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c522b293aaebe34a310e050dd5ba86919d956431

commit c522b293aaebe34a310e050dd5ba86919d956431
Author:     Erik Clarizio <eclarizi>
AuthorDate: Wed May 4 10:55:10 2016 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Wed May 4 10:56:32 2016 -0700

    Convert values by data_type for #value and #automate_output_value
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1328226

 app/models/dialog_field_text_box.rb       | 12 +++++--
 spec/models/dialog_field_text_box_spec.rb | 54 +++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 3 deletions(-)

Comment 10 Shveta 2016-05-18 23:22:22 UTC
Fixed.
Verified in 5.6.0.7-beta2.6.20160516171555_b1be31f

Comment 12 errata-xmlrpc 2016-06-29 15:51:06 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:1348


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