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

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rjmasikome RianA
              Votes:
              29 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

                Created:
                Updated: