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

Macro parameters referencing pages in current space break when copying to new space

    XMLWordPrintable

Details

    Description

      Summary

      The bug was found when vendor was testing their macro but this issue affects any macro using "confluence-content" parameters. This affects both Cloud and Server.

      All details here are provided by the vendor

      Replication steps:

      Preparation (in space SRC):

      1. Add a macro that takes a page as a parameter to a page A
      2. Set page C in the current space (SRC) as the value of the parameter

      Different variants of the bug:

      1. Copy-paste the macro:
        1. Open editor for the page A
        2. Select the macro placeholder in editor and choose copy
        3. Open editor for a page B in another space DEST
        4. Paste the macro from page A to the editor for page B
        5. Save page B
          -> the macro does not point to the page SRC:C anymore
          -> unless the DEST space has a page with title C the macro breaks (eg "unable to render {include}
          The page could not be found" is shown)
      1. Copy page and change location in editor to new space
        1. Open the page A
        2. Choose copy
        3. In the editor opened for copy of page A, click 'location' (next to breadcrumb)
        4. Choose a page in another space (eg DEST) as the new parent
        5. Save
          -> same problems as in variant A
      2. Copy page directly to new space (without children)
        1. same as B but choose a parent page in different space already in the "pick location" dialog opened after clicking on "copy"
        2. the "pick location" dialog is not shown at all on Cloud, so 3rd affects only Server

      Expected

      When macro is copied to new space the relative link to a page in its original space is qualified with the original space key (turned into an absolute link)

      Actual

      The link breaks

      Affects/Impact

      This affects any macro saving a page reference to a macro parameter with type "confluence-content" (for example "Include page" or "Excerpt include")

      Customer Installation Impacts: 1,215

      Notes

      • in all cases using a Link to page A works correctly but macro parameters break
      • the macro user (or developer) cannot choose to use an absolute link to a page in current space by qualifying with the space key when setting the parameter value. Confluence will automatically (in some cases) turn links to pages in current space to be relative (always using absolute references would also solve the problems with page titles including ':'...)
      • the copy operations seem to work correctly when the editor is not involved, so the bug is in handling the macro parameters in "editor format" (ie the data-macro-* attributes on the macro placeholder)
      • have not tested if this happens also with macros with body, it happens at least for any bodiless macro
      • tested on Confluence Cloud, and Confluence 6.0 + 6.12 on Server

      Workaround

      No current workaround. This will be change once a workaround is possible

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              acalantog Anne Calantog
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: