Bug 1540894 - API: edit action is repeated in response of GET custom button
Summary: API: edit action is repeated in response of GET custom button
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: Parthvi Vala
URL:
Whiteboard: :ui:custom_button
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-01 09:43 UTC by Anurag
Modified: 2019-02-07 23:01 UTC (History)
6 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-07 23:01:05 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:0212 0 None None None 2019-02-07 23:01:10 UTC

Comment 3 CFME Bot 2018-02-13 13:15:39 UTC
New commit detected on ManageIQ/manageiq-api/master:
https://github.com/ManageIQ/manageiq-api/commit/c622ed7d720b0e34e626195e750231bbd04043fe

commit c622ed7d720b0e34e626195e750231bbd04043fe
Author:     Jillian Tullo <jtullo>
AuthorDate: Mon Feb 12 16:23:39 2018 -0500
Commit:     Jillian Tullo <jtullo>
CommitDate: Mon Feb 12 16:23:39 2018 -0500

    Do not return duplicate "edit" action entries
    
    In the api.yml, some collections define the put and patch methods, while others do not although they are allowed by default due to the verb specification. In the case where the put and/or patch methods are defined, the edit actions were being duplicated. This ensures they are only present once each.
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1540894

 app/controllers/api/base_controller/renderer.rb |  2 +-
 spec/requests/custom_buttons_spec.rb            | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

Comment 5 Parthvi Vala 2018-10-31 08:16:12 UTC
FIXED. Verified on 5.10.0.21.20181023151612_4c11b0d.

Request: POST https://<ip_address>/api/custom_buttons/1
Response: {
	"href": "https://<ip_address>/api/custom_buttons/1",
	"id": "1",
	"guid": "e39f18aa-bc08-4e7c-a6f0-19935d6c468d",
	"description": "Button",
	"applies_to_class": "User",
	"visibility_expression": null,
	"options": {
		"button_icon": "ff ff-region",
		"button_type": "default",
		"display": true,
		"open_url": false,
		"display_for": "single",
		"submit_how": "one"
	},
	"userid": "admin",
	"wait_for_complete": null,
	"created_on": "2018-10-31T08:09:04Z",
	"updated_on": "2018-10-31T08:09:04Z",
	"name": "custom_button",
	"visibility": {
		"roles": [
			"_ALL_"
		]
	},
	"applies_to_id": null,
	"enablement_expression": null,
	"disabled_text": null,
	"actions": [
		{
			"name": "edit",
			"method": "post",
			"href": "https://<ip_address>/api/custom_buttons/1"
		},
		{
			"name": "edit",
			"method": "patch",
			"href": "https://<ip_address>/api/custom_buttons/1"
		},
		{
			"name": "edit",
			"method": "put",
			"href": "https://<ip_address>/api/custom_buttons/1"
		},
		{
			"name": "delete",
			"method": "post",
			"href": "https://<ip_address>/api/custom_buttons/1"
		},
		{
			"name": "delete",
			"method": "delete",
			"href": "https://<ip_address>/api/custom_buttons/1"
		}
	]
}

Comment 6 errata-xmlrpc 2019-02-07 23:01:05 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:0212


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