Bug #23458
closed
content_view_versions is not showing correct data for composite_content_view_id
Added by Thomas McKay over 6 years ago.
Updated about 6 years ago.
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1573193
We are trying to delete one specific version of one CV from foreman.
The version ID is 234.
We expect the call
"""
https://server.example.com/katello/api/content_view_versions/234
"""
To show an array of composite content view in "composite_content_view_ids", for the CCV using this CV.
Here the code
"""
- curl -X GET -k -u admin:xxx -H "Accept: application/xml" https://server.example.com:443/katello/api/content_view_versions/234
{"version":"16.0","major":16,"minor":0,"composite_content_view_ids":[],"content_view_id":5,
""
Upon deletion,
- curl -X DELETE -k -u admin:xxx -H "Accept: application/xml" https://server.example.com:443/katello/api/content_view_versions/234
{"displayMessage":"Cannot delete version while it is in use by composite content views: RHEL7_Rolling_Capsule Version 10.0,RHEL7_Rolling Version 13.0","errors":["Cannot delete version while it is in use by composite content views: RHEL7_Rolling_Capsule Version 10.0,RHEL7_Rolling Version 13.0"]}
========
Is the creation of the composite_content_view_id array bugged or are we missing something?
- Subject changed from content_view_versions is not showing correct data for composite_content_view_id
to content_view_versions is not showing correct data for composite_content_view_id
- Assignee set to Thomas McKay
- Translation missing: en.field_release set to 352
The content view version model never has any values in composite_content_views. Fetching id 8 of a composite content view version has empty list. This is the db at the time
katello=# select * from katello_content_view_components;
id | content_view_version_id | composite_content_view_id | created_at | updated_at | content_view_id | latest
----+-------------------------+---------------------------+----------------------------+----------------------------+-----------------+--------
1 | | 8 | 2018-04-30 13:48:49.614539 | 2018-04-30 13:48:49.614539 | 3 | t
2 | | 8 | 2018-04-30 13:48:49.62287 | 2018-04-30 13:48:49.62287 | 6 | t
(2 rows)
The UI doesn't rely on this field but instead makes a call to API which does return results as expected.
https://devel.example.com/katello/api/v2/content_view_versions?composite_version_id=8
# cvv.composite_content_views goes through cvv.content_view_components
pry(main)> cvv.content_view_components.to_sql
=> "SELECT \"katello_content_view_components\".* FROM \"katello_content_view_components\" WHERE \"katello_content_view_components\".\"content_view_version_id\" = 4"
As we can see in http://projects.theforeman.org/issues/23458#note-2, the components don't have the content_view_version_id attribute set.
- Is duplicate of Bug #25143: composite_content_view_ids field of a content_view_version is always empty added
- Status changed from New to Closed
Also available in: Atom
PDF