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

Some functions of {attachment} macro does not work when the page is included in another page using {include} macro

    XMLWordPrintable

Details

    Description

      Steps to reproduce
      1. Create pageA and attach some files
        • Insert {attachments} macro
      2. Create pageB
        • Insert {include:pageA}
      3. View pageB
        • Clicking on Properties will result System Error page with the following stack trace:
          java.lang.NullPointerException
              at com.atlassian.confluence.pages.actions.MoveAttachmentAction.bootstrap(MoveAttachmentAction.java:115)
          
          Stack Trace:[hide]
          
          java.lang.NullPointerException
          	at com.atlassian.confluence.pages.actions.MoveAttachmentAction.bootstrap(MoveAttachmentAction.java:115)
          	at com.atlassian.confluence.setup.webwork.BootstrapAwareInterceptor.intercept(BootstrapAwareInterceptor.java:18)
          	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
          	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
          	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
          	at com.atlassian.confluence.user.actions.UserAwareInterceptor.intercept(UserAwareInterceptor.java:58)
          
        • Clicking on Remove does not take effect
        • Clicking on View (for Office files) will result Page Not Found
      Findings

      Possible cause: the link of attachments in pageB is referring to pageid of pageB instead of its source pageid (pageA)

      Workaround

      Just found out that if you click on Remove once in pageB, all functions of attachments macro will work fine as the pageid is now referring to the correct source (pageA).
      However, be careful in clicking on Remove link twice as it will remove the attachment

      Attachments

        1. pageA.jpg
          pageA.jpg
          231 kB
        2. pageB.jpg
          pageB.jpg
          254 kB
        3. pagenotfound.jpg
          pagenotfound.jpg
          88 kB

        Issue Links

          Activity

            People

              kfchong KaiA
              halatas HuseinA
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: