Bug 1389187 - Changes to class attribute default value are discarded
Summary: Changes to class attribute default value are discarded
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.8.0
Assignee: Harpreet Kataria
QA Contact: Shveta
URL:
Whiteboard: automate:ui
: 1396412 (view as bug list)
Depends On:
Blocks: 1393027 1396412 1399285
TreeView+ depends on / blocked
 
Reported: 2016-10-27 06:55 UTC by Fabien Dupont
Modified: 2017-06-12 16:20 UTC (History)
9 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1393027 1399285 (view as bug list)
Environment:
Last Closed: 2017-06-12 16:20:58 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Fabien Dupont 2016-10-27 06:55:09 UTC
Description of problem:

When modifying a validated class attribute, the changes are discarded, making it impossible to update a class schema after creation.

The same behavior is observed when the 'Edit selected schema' is used. The first validated default value seems to be immutable.

Version-Release number of selected component (if applicable): 5.7.0.7-beta1.20161025153249_9376fbd


How reproducible: always


Steps to Reproduce:
1. Create a class with an attribute called 'field1' of type string, with a default value of 'a' and click on the 'tick' symbol to validate it.
2. Change the default value to 'b' and click 'Save'.

Actual results:
The recorded default value is still 'a'.

Expected results:
The recorded value should be 'b'.

Additional info:

Below, the log line in /var/www/miq/vmdb/log/evm.log

[----] I, [2016-10-27T08:42:21.598499 #25428:a5ace4]  INFO -- Success: MIQ(MiqAeClassController.update_fields) userid: [admin] - [Test] Record updated (fields:[[{"aetype"=>"attribute", "class_id"=>33000000000149, "collect"=>nil, "datatype"=>"[FILTERED]", "default_value"=>"a", "description"=>nil, "display_name"=>nil, "id"=>33000000001330, "max_retries"=>nil, "max_time"=>nil, "message"=>"create", "name"=>"field1", "on_entry"=>nil, "on_error"=>nil, "on_exit"=>nil, "priority"=>1, "substitute"=>true}]] to [[{"aetype"=>"attribute", "class_id"=>33000000000149, "collect"=>nil, "datatype"=>"[FILTERED]", "default_value"=>"a", "description"=>nil, "display_name"=>nil, "id"=>33000000001330, "max_retries"=>nil, "max_time"=>nil, "message"=>"create", "name"=>"field1", "on_entry"=>nil, "on_error"=>nil, "on_exit"=>nil, "priority"=>1, "substitute"=>true, :default_value=>"b"}]])

As you can see, the correct information is passed. There is no additionnal log.

Comment 3 Harpreet Kataria 2016-11-01 02:11:28 UTC
https://github.com/ManageIQ/manageiq/pull/12322

Comment 4 CFME Bot 2016-11-03 21:26:25 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b28d17cbaa73ca7bd0f090b386109ac66d73eeba

commit b28d17cbaa73ca7bd0f090b386109ac66d73eeba
Author:     Harpreet Kataria <hkataria>
AuthorDate: Mon Oct 31 22:08:42 2016 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Tue Nov 1 10:17:50 2016 -0400

    Changed to have consistency in keys in schema editor
    
    - Made changes to automate schema editor code to get/set all keys in @edit as symbols, some of the keys in existing code were symbols and others were strings, changed them all to be symbols.
    - Added spec test to verify changes and fixed any existing broken spec tests.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1389187

 app/controllers/miq_ae_class_controller.rb         | 21 +++---
 app/views/miq_ae_class/_class_fields.html.haml     | 24 +++----
 spec/controllers/miq_ae_class_controller_spec.rb   | 75 +++++++++++++++-------
 .../miq_ae_class/_class_fields.html.haml_spec.rb   | 57 ++++++++++++++++
 4 files changed, 133 insertions(+), 44 deletions(-)
 create mode 100644 spec/views/miq_ae_class/_class_fields.html.haml_spec.rb

Comment 5 CFME Bot 2016-11-07 20:55:58 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/a3d263ac8e2a6ce288fc07b74e0d02cc06149ab2

commit a3d263ac8e2a6ce288fc07b74e0d02cc06149ab2
Author:     Dan Clarizio <dclarizi>
AuthorDate: Thu Nov 3 14:24:57 2016 -0700
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Mon Nov 7 15:51:10 2016 -0500

    Merge pull request #12322 from h-kataria/class_schema_editor_fix
    
    Changed to have consistency in keys in schema editor
    (cherry picked from commit 32f1bc8cc20dec7bbed5caf52f90b874f1c533cc)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1389187

 app/controllers/miq_ae_class_controller.rb         | 21 +++---
 app/views/miq_ae_class/_class_fields.html.haml     | 24 +++----
 spec/controllers/miq_ae_class_controller_spec.rb   | 75 +++++++++++++++-------
 .../miq_ae_class/_class_fields.html.haml_spec.rb   | 57 ++++++++++++++++
 4 files changed, 133 insertions(+), 44 deletions(-)
 create mode 100644 spec/views/miq_ae_class/_class_fields.html.haml_spec.rb

Comment 8 Harpreet Kataria 2016-11-28 16:59:31 UTC
*** Bug 1396412 has been marked as a duplicate of this bug. ***

Comment 9 Harpreet Kataria 2016-11-28 17:00:24 UTC
*** Bug 1399285 has been marked as a duplicate of this bug. ***

Comment 10 Shveta 2017-03-13 04:40:00 UTC
Default value changes.
verified in 5.8.0.4.20170307183144_745a3d9


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