Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1328226 - Multiple problems with integer type textbox dialog field
Multiple problems with integer type textbox dialog field
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS (Show other bugs)
unspecified
Unspecified Unspecified
high Severity medium
: GA
: 5.6.0
Assigned To: eclarizi
Shveta
service:dialog
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-18 14:57 EDT by Bill Wei
Modified: 2016-06-29 11:51 EDT (History)
6 users (show)

See Also:
Fixed In Version: 5.6.0.6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-29 11:51:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 14:50:04 EDT

  None (edit)
Description Bill Wei 2016-04-18 14:57:00 EDT
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 09:56:12 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c14696d0f354daf54fe481a520cd2e820cdac869

commit c14696d0f354daf54fe481a520cd2e820cdac869
Author:     Erik Clarizio <eclarizi@redhat.com>
AuthorDate: Mon May 2 13:46:07 2016 -0700
Commit:     Erik Clarizio <eclarizi@redhat.com>
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 09:56:15 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c55986f160b689e34b03dca3d15e917b1d670aa2

commit c55986f160b689e34b03dca3d15e917b1d670aa2
Author:     Erik Clarizio <eclarizi@redhat.com>
AuthorDate: Mon May 2 13:46:38 2016 -0700
Commit:     Erik Clarizio <eclarizi@redhat.com>
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 09:56:19 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/0186bae03480c0d7949cc535d8f2061bdbfae2db

commit 0186bae03480c0d7949cc535d8f2061bdbfae2db
Author:     Erik Clarizio <eclarizi@redhat.com>
AuthorDate: Tue May 3 11:02:37 2016 -0700
Commit:     Erik Clarizio <eclarizi@redhat.com>
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 09:56:23 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/476d60ba115e0f8750a2955d7eec2f8d680f8286

commit 476d60ba115e0f8750a2955d7eec2f8d680f8286
Author:     Erik Clarizio <eclarizi@redhat.com>
AuthorDate: Tue May 3 11:03:46 2016 -0700
Commit:     Erik Clarizio <eclarizi@redhat.com>
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 09:56:27 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c522b293aaebe34a310e050dd5ba86919d956431

commit c522b293aaebe34a310e050dd5ba86919d956431
Author:     Erik Clarizio <eclarizi@redhat.com>
AuthorDate: Wed May 4 10:55:10 2016 -0700
Commit:     Erik Clarizio <eclarizi@redhat.com>
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 19:22:22 EDT
Fixed.
Verified in 5.6.0.7-beta2.6.20160516171555_b1be31f
Comment 12 errata-xmlrpc 2016-06-29 11:51:06 EDT
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.