-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
5.7.3, 1000.100.0
-
43
-
Severity 2 - Major
-
9
-
NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.
Summary:
copy a page with linked attachment to another space will break the attachment link
Steps to Reproduce
- Create a page, insert an attachement (attachment1.jpg)
- Create a new page within the same space
- Insert a link of the attachement by:
- Click Insert more content
- Files and Images
- Search on other pages > Search for the attachment >(write "attachment1 on the field) Search > Choose the image > Insert
- Save Page
- Move this page to other space by:
- Tools
- Copy
- Set New Location to new space and parent page
- Save
This also happens when copying a page with a link to pages on the same space and trying to copy it:
The source of the origin page is:
<p class="auto-cursor-target"><ac:link><ri:page ri:content-title="Page B" /></ac:link></p> <p class="auto-cursor-target"><ac:link><ri:page ri:space-key="another space" ri:content-title="Page C" /></ac:link></p> <p><br /></p>
Note that if the link is from a page on the same space, the space name is NOT saved on the html file. In case the link is to a page to another space, it is.
When copying it does not change that as it does when you move.
This is the storage format of a page after you move it:
<p><ac:link><ri:page ri:content-title="Page 2" ri:space-key="SOUR" /></ac:link></p> <p><ac:link><ri:page ri:space-key="FOR" ri:content-title="Page 3" /></ac:link></p>
And this is the storage format after you copy it:
<p><ac:link><ri:page ri:content-title="Page 2" /><ac:plain-text-link-body><![CDATA[Page 2]]></ac:plain-text-link-body></ac:link></p> <p><ac:link><ri:page ri:space-key="FOR" ri:content-title="Page 3" /></ac:link></p>
Expected Results
Page copied normally with the attachment link and page links still intact.
Actual Results
The image link has broken.
The linked page is not correctly referenced and when clicked on its link on the newly copied page it offers to create a new page.
Workaround
Copy to somewhere in same space then move to new location in new space:
- Tools
- Copy
- Save to a temporary location within same space
- Tools
- Move
- Set New Location to new space and new parent page
Moving the page to a new space will properly reference the linked page.
Notes
Upon investigating, it seems like there is a difference of macro defined to link attachemnet from the same space and from different space
Storage format of page containing attachment from the same space:
<p><ac:image><ri:attachment ri:filename="connie.PNG"><ri:page ri:content-title="Confluence" /></ri:attachment></ac:image></p>
Storage format of page containing attachment from different space:
<p><ac:image ac:height="250"><ri:attachment ri:filename="connie.PNG"><ri:page ri:content-title="Confluence" ri:space-key="T5S" /></ri:attachment></ac:image></p>
(note the "space-key")
For more information please check the screencast attached
- duplicates
-
CONFSERVER-36497 Attachment missing in confluence pages
- Closed
- is duplicated by
-
CONFSERVER-39975 Attachments on a page are broken after moving page trees between spaces
- Closed
- relates to
-
CONFCLOUD-37772 Copying page with linked attachment to another space will break the attachment link
- Closed