Bug 1161701

Summary: Automate Explorer: "Error during 'save': Validation failed: Datatype is not included in the list" when trying to save input parameters for a Method
Product: Red Hat CloudForms Management Engine Reporter: Harpreet Kataria <hkataria>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED ERRATA QA Contact: Dave Johnson <dajohnso>
Severity: high Docs Contact:
Priority: high    
Version: 5.3.0CC: sshveta
Target Milestone: GA   
Target Release: 5.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.4.0.0.11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1161761 (view as bug list) Environment:
Last Closed: 2015-06-16 12:44:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1161761    

Description Harpreet Kataria 2014-11-07 16:39:00 UTC
Description of problem:"Error during 'save': Validation failed: Datatype is not included in the list" when trying to save input parameters for a Method


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


How reproducible:


Steps to Reproduce:
1. Edit a Method in Automate Explorer
2. Save Input Parameters for a method.
3. Go back to same method, deleted existing Input Parameters, then try to save input parameters with same name, that displays flash message on screen: Error during 'save': Validation failed: Datatype is not included in the list

Actual results: Flash message on screen. doesn't let user save input parameters


Expected results: It should save new added input parameters.


Additional info:

Comment 1 mkanoor 2014-11-07 16:45:31 UTC
I also noticed that the datatype is not being set to string for the fields even though it shows as string in the UI. In our model code
validates_inclusion_of  :datatype,   :in => AVAILABLE_DATATYPES, :allow_nil => true  # nil =      > string
we allow for nil to be equivalent to strings.
We should select the datatype to be string and autoselect it instead of using nil to mean string. The order of the datatypes is pre canned to be 
AVAILABLE_DATATYPES_FOR_UI = [ "string", "symbol", "integer", "float", "boolean", "time", "array", "password"]

If someone changes this array to have integer to be first element the user would think that the datatype is integer but we will set it to nil (string)

Comment 2 CFME Bot 2014-11-14 17:50:48 UTC
New commit detected on cfme/master:
https://github.com/ManageIQ/manageiq/commit/175caf6f4d91aa02c63b044d3eb9e8e8b57b5e6e

commit 175caf6f4d91aa02c63b044d3eb9e8e8b57b5e6e
Author:     Harpreet Kataria <hkataria>
AuthorDate: Fri Nov 7 16:17:12 2014 -0500
Commit:     Harpreet Kataria <hkataria>
CommitDate: Wed Nov 12 13:58:10 2014 -0500

    Fixed saving on Input Parameters for Automate Method.
    
    - Fixed to set/save default value for datatype of an Automate Method Input field to be 'string'.
    - Fixed saving of input parameters when adding a new Method.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1161761
    https://bugzilla.redhat.com/show_bug.cgi?id=1161701

 vmdb/app/controllers/miq_ae_class_controller.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comment 3 CFME Bot 2014-11-14 17:51:06 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/175caf6f4d91aa02c63b044d3eb9e8e8b57b5e6e

commit 175caf6f4d91aa02c63b044d3eb9e8e8b57b5e6e
Author:     Harpreet Kataria <hkataria>
AuthorDate: Fri Nov 7 16:17:12 2014 -0500
Commit:     Harpreet Kataria <hkataria>
CommitDate: Wed Nov 12 13:58:10 2014 -0500

    Fixed saving on Input Parameters for Automate Method.
    
    - Fixed to set/save default value for datatype of an Automate Method Input field to be 'string'.
    - Fixed saving of input parameters when adding a new Method.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1161761
    https://bugzilla.redhat.com/show_bug.cgi?id=1161701

 vmdb/app/controllers/miq_ae_class_controller.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comment 4 CFME Bot 2014-11-14 18:15:27 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=4161e1b68f7fbe22e5515df9e482305a8a5cc104

commit 4161e1b68f7fbe22e5515df9e482305a8a5cc104
Author:     Harpreet Kataria <hkataria>
AuthorDate: Wed Nov 12 13:58:10 2014 -0500
Commit:     Harpreet Kataria <hkataria>
CommitDate: Fri Nov 14 13:10:40 2014 -0500

    Fixed saving on Input Parameters for Automate Method.
    
    - Fixed to set/save default value for datatype of an Automate Method Input field to be 'string'.
    - Fixed saving of input parameters when adding a new Method.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1161761
    https://bugzilla.redhat.com/show_bug.cgi?id=1161701
    (cherry picked from commit 175caf6)

 vmdb/app/controllers/miq_ae_class_controller.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comment 5 Shveta 2015-02-27 22:31:23 UTC
upstream_verified
master.20150219134229_64c0205

Comment 7 Shveta 2015-03-13 18:36:46 UTC
Fixed .
Verified in 5.4.0.0.11.20150309201930_8b6a235

Comment 9 errata-xmlrpc 2015-06-16 12:44:11 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://rhn.redhat.com/errata/RHBA-2015-1100.html