Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-37772

Copying page with linked attachment or with a link to a page in the same space to another space will break those links

      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

      1. Create a page, insert an attachement (attachment1.jpg)
      2. Create a new page within the same space
      3. 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
      4. Move this page to other space by:
        • Tools
        • Copy
        • Set New Location to new space and parent page
      5. 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

        1. Capture.PNG
          Capture.PNG
          6 kB
        2. attachmentbug.mp4
          2.41 MB

            [CONFSERVER-37772] Copying page with linked attachment or with a link to a page in the same space to another space will break those links

            This problem doesn't affect "only" attachment links. It also affects links to other pages within the same space. Also for those links the space-key attribute is not added when copying to another space

            Thomas Andres added a comment - This problem doesn't affect "only" attachment links. It also affects links to other pages within the same space. Also for those links the space-key attribute is not added when copying to another space

            I have no idea if this is the same, or similar to the other reported bug, https://jira.atlassian.com/browse/CONFSERVER-55928, but I am very surprised that these issues aren't at least linked together. We have been seeing both issues still on 7.4.1.

            Rick

            Rick Carini added a comment - I have no idea if this is the same, or similar to the other reported bug, https://jira.atlassian.com/browse/CONFSERVER-55928 , but I am very surprised that these issues aren't at least linked together. We have been seeing both issues still on 7.4.1. Rick

            We hit this bug - especially the dead links after copy regularly. Is there any estimation when it will bei fixed (its over 5 years old now  )?

            Michael Wenig added a comment - We hit this bug - especially the dead links after copy regularly. Is there any estimation when it will bei fixed (its over 5 years old now  )?

            Simon added a comment -

            As Paul Cheng already stated in an earlier comment from 2015: this bug also appears when copying a page containing links to pages within the same space to another space. 

            Simon added a comment - As Paul Cheng already stated in an  earlier comment from 2015 : this bug also appears when copying a page containing links to pages within the same space to another space. 

            Ed Wilts added a comment -

            +2

            Silent failures are the worst kind of failures.  The copy appears successful but customers end up with partially unusable pages. 

            Ed Wilts added a comment - +2 Silent failures are the worst kind of failures.  The copy appears successful but customers end up with partially unusable pages. 

            +1 We have been hitting this for a while now.  When you have pages with many links in it SOME work and SOME don't so you don't immediately realize that there is a problem.  How many customers have been using the Copy function and not realizing till later that the links are broken so they have no clue what caused the problem.

            Is there a way to figure out what pages we have in our environment with broken links?

            Please raise the priority on this issue.  

            Thanks.

            Chris Blackmor added a comment - +1 We have been hitting this for a while now.  When you have pages with many links in it SOME work and SOME don't so you don't immediately realize that there is a problem.  How many customers have been using the Copy function and not realizing till later that the links are broken so they have no clue what caused the problem. Is there a way to figure out what pages we have in our environment with broken links? Please raise the priority on this issue.   Thanks.

            +2 for Critical.

            When using Confluence, once should not have to think "Is this a command that will break my documents"? All this functionality should be transparent and work flawlessly.

            I'm also surprised this bug has languished without being fixed for over two years...

            Thank you.

             

            Stephen Kairys added a comment - +2 for Critical. When using Confluence, once should not have to think "Is this a command that will break my documents"? All this functionality should be transparent and work flawlessly. I'm also surprised this bug has languished without being fixed for over two years... Thank you.  

            My company recently hit this issue, it caused us to have several hundred attachments go 'missing' after someone tried to move 479 pages between spaces. We're not sure if it was caused by the initial move or when the user attempted to move the pages back. Either way, we had to invoke https://confluence.atlassian.com/confkb/how-to-resolve-missing-attachments-in-confluence-201761.html to restore the links to attachments.

            David Hergert (PAYX) added a comment - My company recently hit this issue, it caused us to have several hundred attachments go 'missing' after someone tried to move 479 pages between spaces. We're not sure if it was caused by the initial move or when the user attempted to move the pages back. Either way, we had to invoke https://confluence.atlassian.com/confkb/how-to-resolve-missing-attachments-in-confluence-201761.html to restore the links to attachments.

            - added a comment -

            +1 for critical too.

            - added a comment - +1 for critical too.

            Luca added a comment -

            +1 vote for increasing priority as suggested by Hans-Peter Geier.
            Thanks!

            Luca added a comment - +1 vote for increasing priority as suggested by Hans-Peter Geier. Thanks!

              Unassigned Unassigned
              mkhairuliana Monique Khairuliana (Inactive)
              Affected customers:
              62 This affects my team
              Watchers:
              55 Start watching this issue

                Created:
                Updated: