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

Links to anchors in another Confluence space break when they are edited because the spacekey is dropped

      Problem

      • Links to an anchor in a Confluence page of another space are broken when they are edited.

      Steps to Reproduce

      1. Select the text that you want to link
      2. Click Insert >> Link, and go to Advanced tab
      3. In the Advanced tab, configure the link to point to an anchor in another page using this format:
        SPACEKEY:PageName#AnchorName
        
      4. Save the link and the page.
      5. Click the link.
      6. Return to the page you edited and re-edit the link.
      7. Save the link without making any changes and save the page.
      8. Click the link.
      9. Return to the page you edited and attempt to re-edit the link.

      Expected Results

      • Both times it is clicked, the link should take you to the correct destination page and scroll to the anchor.

      Actual Results

      • The link only works the first time.
      • When you return and edit the link, the "SPACKEY:" prefix is removed without notice. The link becomes:
        PageName#AnchorName
        
      • When this problem occurs, clicking the link takes you to a Create view to create a page with that name in the current space.

      Notes

      On the first edit the link configuration appears to be correct in the source markup:

      <ac:link ac:anchor="ANCHORNAME">
          <ri:page ri:content-title="PAGETITLE" ri:space-key="SPACKEY"/>
          <ac:plain-text-link-body><![CDATA[LINKTEXT]]></ac:plain-text-link-body>
      </ac:link>
      

      When editing the second time the source markup is unchanged, but in the Edit dialog the space prefix is removed:

      After the second edit the ri:space-key parameter is dropped.

      <ac:link>
          <ri:page ri:content-title="Disabling and enabling apps"/>
          <ac:plain-text-link-body><![CDATA[enable safe mode]]></ac:plain-text-link-body>
      

      The original reporter also noted, "It used to be uneditable prior to 4.3.6, as it was fixed in that version."

      Workaround

      Use the "Web Link" option instead and paste in the absolute/static URL, e.g. http(s)://HOST/SPACEKEY/PAGE#ANCHOR

      NOTE: This link breaks if the name or space of the target page is changed.

            [CONFSERVER-28087] Links to anchors in another Confluence space break when they are edited because the spacekey is dropped

            MD Wilson added a comment -

            The only reliable workaround I have found for this is to copy a table of contents entry from the source page and use that as the link instead of linking to an anchor.

            MD Wilson added a comment - The only reliable workaround I have found for this is to copy a table of contents entry from the source page and use that as the link instead of linking to an anchor.

            I have hundreds of pages that reference macros from a different space.  Everything has been working fine for the past 2-3 years and last week I'm getting this behavior where the spacekey is removed from the macro in some cases where I edit the page, in other instances, just rendering previously existing pages from months-years ago.  We upgraded a lot of macros but no changes were made to the version of Confluence we're on (7.13.3).  We've never run into this problem until now and thought it was an addon vendor issue.  After working with the vendor for close to a week, they have concluded this is a Confluence bug and led me to this issue to submit my feedback.  I'm not sure what could have changed in Confluence to make this happen when it has not been a problem previously, and we make new pages weekly (~50) and reference existing pages that contain data such are metrics from previous sprints.  The only remedy at this time is to go into every affected page (and there are hundreds for us) and reestablish the spaceky for the macro.  This is not a workable solution!

            BMJ Ventures added a comment - I have hundreds of pages that reference macros from a different space.  Everything has been working fine for the past 2-3 years and last week I'm getting this behavior where the spacekey is removed from the macro in some cases where I edit the page, in other instances, just rendering previously existing pages from months-years ago.  We upgraded a lot of macros but no changes were made to the version of Confluence we're on (7.13.3).  We've never run into this problem until now and thought it was an addon vendor issue.  After working with the vendor for close to a week, they have concluded this is a Confluence bug and led me to this issue to submit my feedback.  I'm not sure what could have changed in Confluence to make this happen when it has not been a problem previously, and we make new pages weekly (~50) and reference existing pages that contain data such are metrics from previous sprints.  The only remedy at this time is to go into every affected page (and there are hundreds for us) and reestablish the spaceky for the macro.  This is not a workable solution!

            MichałS added a comment -

            The same error in version 5.9.6

            MichałS added a comment - The same error in version 5.9.6

            Verified that that bug persists in Confluence 5.5.2 as well.

            Fred Bunting added a comment - Verified that that bug persists in Confluence 5.5.2 as well.

            MichałS added a comment -

            We've run into the same problem (Confluence 5.4.4).
            Nice if this could be fixed.

            MichałS added a comment - We've run into the same problem (Confluence 5.4.4). Nice if this could be fixed.

            Fred Bunting added a comment - - edited

            We've run into this problem too (Confluence 5.1.3).

            It's a real annoyance because it makes it really easy to break links. If you just click on the link to Edit it, (e.g. to change the displayed text) but don't make any change to the actual link itself, when you click Save, you've just broken the link.

            And since you can't edit broken links, you have to start over.

            Fred Bunting added a comment - - edited We've run into this problem too (Confluence 5.1.3). It's a real annoyance because it makes it really easy to break links. If you just click on the link to Edit it, (e.g. to change the displayed text) but don't make any change to the actual link itself, when you click Save, you've just broken the link. And since you can't edit broken links, you have to start over.

              Unassigned Unassigned
              rjmasikome RianA
              Affected customers:
              31 This affects my team
              Watchers:
              27 Start watching this issue

                Created:
                Updated: