Bug 1626178

Summary: Validation failed: Cannot set auto publish to a non-composite content view
Product: Red Hat Satellite Reporter: Anand Agrawal <aagrawal>
Component: Content ViewsAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: jpathan, pcreech
Target Milestone: 6.5.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:37:59 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:

Description Anand Agrawal 2018-09-06 17:11:48 UTC
Description of problem:

While creating a new content view, If we select composite content view checkbox and Auto publish checkbox as well, but realised no need of composite content view so unchecked the checkbox composite content view, this will automatically uncheck the autopublish checkbox. But when clicking 'Save' button, it does no action i.e CV not being created.

While checking the firebug console: we see below errors:

{"displayMessage":"Validation failed: Cannot set auto publish to a non-composite content view","errors"
:{"base":["Cannot set auto publish to a non-composite content view"]}}


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

How reproducible:

Always
Steps to Reproduce:
1. Create a new content view, enter details  like name, description
2. Check the composite view checkbox and auto publish checkbox
3. Uncheck the composite view checkbox
4. This will automatically uncheck the auto-publish checkbox
5. Click on 'Save', Nothing happens
6. In the log, you will see
~~~ 
2018-09-06T13:00:24 [I|app|] Started POST "/katello/api/v2/content_views?organization_id=1" for 192.168.122.1 at 2018-09-06 13:00:24 -0400
2018-09-06T13:00:24 [I|app|39431] Processing by Katello::Api::V2::ContentViewsController#create as JSON
2018-09-06T13:00:24 [I|app|39431]   Parameters: {"organization_id"=>"1", "name"=>"anand", "label"=>"anand", "composite"=>false, "auto_publish"=>true, "api_version"=>"v2", "content_view"=>{"name"=>"anand", "label"=>"anand", "organization_id"=>"1", "composite"=>false, "auto_publish"=>true}}
2018-09-06T13:00:24 [I|app|39431] Current user: admin (administrator)
2018-09-06T13:00:24 [E|app|39431] <Class> ActiveRecord::RecordInvalid
2018-09-06T13:00:24 [E|app|39431] base: ["Cannot set auto publish to a non-composite content view"]
2018-09-06T13:00:24 [I|app|39431] Completed 422 Unprocessable Entity in 151ms (Views: 0.3ms | ActiveRecord: 85.8ms)
~~~
Actual results:

Still auto publish is "auto_publish"=>true

Expected results:

auto publish should be set to false
Additional info:

Comment 2 Andrew Kofink 2018-09-13 19:27:15 UTC
Created redmine issue https://projects.theforeman.org/issues/24937 from this bug

Comment 3 Satellite Program 2018-09-19 16:06:15 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24937 has been resolved.

Comment 4 Jameer Pathan 2018-11-01 13:29:31 UTC
verified:

@Satellite 6.5.0 snap 1

steps:
1. Create a new content view, enter details  like name, description
2. Check the composite view checkbox and auto publish checkbox
3. Uncheck the composite view checkbox
4. This will automatically uncheck the auto-publish checkbox
5. Click on 'Save'

observation:

-auto publish should be set to false-production.log gives
~~~
Katello::Api::V2::ContentViewsController#create as JSON
2018-11-01T09:00:17 [I|app|4d702]   Parameters: {"organization_id"=>"1", "auto_publish"=>false, "name"=>"jp5", "label"=>"jp5", "description"=>"jp5", "composite"=>false, "api_version"=>"v2", "content_view"=>{"name"=>"jp5", "label"=>"jp5", "description"=>"jp5", "organization_id"=>"1", "composite"=>false, "auto_publish"=>false}}
2018-11-01T09:00:17 [I|app|4d702] Current user set to admin (admin)
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on name jp5
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on label jp5
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on description jp5
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on organization_id 1
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on default false
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on composite false
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on next_version 1
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on force_puppet_environment false
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on auto_publish false
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on repository_ids []
2018-11-01T09:00:17 [I|aud|4d702] Katello::ContentView (10) create event on environment_ids []
2018-11-01T09:00:17 [I|app|4d702]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0.rc1/app/views/katello/api/v2/common/create.json.rabl within katello/api/v2/layouts/resource
2018-11-01T09:00:17 [I|app|4d702]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0.rc1/app/views/katello/api/v2/common/create.json.rabl within katello/api/v2/layouts/resource (15.1ms)
2018-11-01T09:00:17 [I|app|4d702] Completed 200 OK in 49ms (Views: 13.4ms | ActiveRecord: 10.8ms)
~~~

Comment 8 errata-xmlrpc 2019-05-14 12:37:59 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/RHSA-2019:1222