Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.2.2, 4.2.6, 4.2.8, 4.3, 4.3.2, 4.3.3, 5.0.3, 5.1, 5.1.3
-
None
-
5
-
Description
You cannot link to an attachment attached to a space (and if it has already been indexed). Attachments can be added to a space using WebDAV and/or by uploading a space logo.
Steps to reproduce:
- Create a space (in this example I'll call it HyperSpace)
- Go to the newly created space, set a custom logo for it
- Navigate to Confluence Admin and rebuild your content index, to make sure the modifications get indexed
- Create a new page, start typing '[' then the space key, in this case HYP. The space logo attachment should show (it's name after the space key). Select the attachment and insert the link
(Same issue will occur for attachments uploaded to space directory using WebDAV and then referenced in the editor) - Try saving or previewing the page and you will face an error:
The following error(s) occured: There was an error loading preview, please try again later.
HTTP Status 412 - Precondition FailedOr in Confluence 5.1, you get the following error instead:
The following error(s) occurred:
Failure when converting editor format to storage format.
In atlassian-confluence.log you will find exceptions like:
An error occurred while unmarshalling a link in the editor with the title <SPACE TITLE>
Error creating resource identifier for resource Attachment ...
com.atlassian.confluence.content.render.xhtml.XhtmlException: RuntimeException occurred while transforming editor format to storage format (com.atlassian.confluence.content.render.xhtml.XhtmlException: An error occurred while unmarshalling a link in the editor with the title <SPACE KEY/NAME>
Workaround
Do not insert links referencing attachments attached to a space. You can check which attachments are attached to a space by going to Space Tools > Content Tools > Attachments and looking at the Attached To column