Details
-
Bug
-
Resolution: Fixed
-
Low
-
12
-
Severity 3 - Minor
-
0
-
Description
Issue Summary
Labels containing + characters are not able to be deleted.
In our internal logs we can see the character is not being HTML encoded and is therefore taken as literal for example:
Steps to Reproduce
- Create a confluence page.
- Add a label containing a + symbol.
- Try to delete the label.
Expected Results
- The label should be deleted.
- The label should not able to created.
Actual Results
The label is created and subsequently cannot be removed via the UI and the below error is displayed:
Notes
This error is not immediately helpful, however trying to remove the label via making a DELETE call to the /wiki/rest/api/content/<contentId>/label?name=10+10 endpoint returns the below:
{ "statusCode": 404, "data": { "authorized": false, "valid": true, "errors": [], "successful": false }, "message": "com.atlassian.confluence.api.service.exceptions.NotFoundException: No label found with name: 10" }
Workaround
You are able to workaround this by adjusting the URL and replacing the offending + with %2B and making the DELETE call via REST eg.
curl -X DELETE \ -u <user_email>:<api_token> \ -H 'Accept: application/json' \ -H 'Accept-Encoding: gzip, deflate' \ -H 'Content-Type: application/json' \ 'https://<siteName>.atlassian.net/wiki/rest/api/content/<contentId>/label?name=10%2B10'
It's also possible to use the following code directly on the browser's console:
fetch( "https://{instance}/wiki/rest/api/content/{content_id}/label/{label_name}", { "credentials":"include", "headers":{ "Content-Type": "application/json" }, "method":"DELETE" } ).then((resp) => function(response){ console.log(response); });
Attachments
Issue Links
- Discovered while testing
-
CONFCLOUD-67555 Not able to delete labels on a copied page
- Closed