Bug 1626178 - Validation failed: Cannot set auto publish to a non-composite content view
Summary: Validation failed: Cannot set auto publish to a non-composite content view
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.4
Hardware: All
OS: All
unspecified
medium
Target Milestone: 6.5.0
Assignee: Andrew Kofink
QA Contact: Jameer Pathan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-06 17:11 UTC by Anand Agrawal
Modified: 2019-11-05 22:32 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:37:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24937 0 None None None 2018-09-13 19:27:15 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:38:05 UTC

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


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