Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-73020

Copying a page with body causes the image not be shown on the page

    XMLWordPrintable

Details

    Description

      Issue Summary

      There are a few conditions that can lead to this problem:

      • Copying a page with body causes the image not be shown on the page.
      • Adding an attachment after the page has been created without the image.

      Steps to Reproduce

      Steps to Reproduce: Case #1 - Page Copy

      1. create a parent page: <site>/<space>/pages/402325512/DEVHELP-7212+-+parent+page
      2. create a source page: <site>/<space>/pages/402161672/DEVHELP-7212+-+copy+page+-broken+attachments-+source+page. Notice that the attachment here is called background.png
      3. copy the page but provide a body with an attachment called image.png
        curl --request POST \
          --url '<site>/wiki/rest/api/content/402161672/copy' \
          --header 'Accept: application/json;charset=UTF-8' \
          --header 'Content-Type: application/json' \
          --data '{
           "copyAttachments": true,
           "copyPermissions": false,
           "copyProperties": false,
           "copyLabels": true,
           "copyCustomContents": false,
           "destination": {
             "type": "parent_page",
             "value": "402325512"
           },
           "pageTitle": "DEVHELP-7212 - Target Page 1",
           "body": {
              "storage": {
               "representation": "storage",
               "value": "<ac:image><ri:attachment ri:filename=\"image.png\" ri:version-at-save=\"1\" /></ac:image>"
             }
           }
        }' \
        --basic --user '<userEmail>:<token>'
        
      4. create another page which is going to be the source for the image: <site>/<space>/pages/402489345/DEVHELP-7212+-+source+page+image+only. The attachment here is called image.png
      5. copy the new page (the one with the source image) with the existing_page with id 402456577 as the target page
        curl --request POST \
          --url '<site>/wiki/rest/api/content/402489345/copy' \
          --header 'Accept: application/json;charset=UTF-8' \
          --header 'Content-Type: application/json' \
          --data '{
           "copyAttachments": true,
           "copyPermissions": false,
           "copyProperties": false,
           "copyLabels": true,
           "copyCustomContents": false,
           "destination": {
             "type": "existing_page",
             "value": "402456577"
           },
           "pageTitle": "DEVHELP-7212 - Target Page 1",
           "body": {
              "storage": {
               "representation": "storage",
               "value": "<ac:image><ri:attachment ri:filename=\"image.png\" ri:version-at-save=\"1\" /></ac:image>"
             }
           }
        }' \
        --basic --user '<userEmail>:<token>'
        

      Steps to Reproduce: Case #2 - Adding an attachment at a later stage

      1. Create a page with a image.png in the body
        curl --request POST \
          --url '<site>/wiki/rest/api/content' \
          --header 'Accept: application/json;charset=UTF-8' \
          --header 'Content-Type: application/json' \
          --data '{
          "type": "page",
          "title": "DEVHELP-7234-1",
          "space": { "key": "FIRSTSPACE" },
          "ancestors": [{ "type": "page", "id": "98306" }],
          "body": {
            "storage": {
              "value": "<ac:image ac:align=\"center\"><ri:attachment ri:filename=\"image.png\" /></ac:image>",
              "representation": "storage"
            }
          }
        }' \
        --basic --user '<userEmail>:<token>'
        
      2. Upload the attachment called image.png
        curl -D- \
          --url <site>/wiki/rest/api/content/405635073/child/attachment \
          -X POST \
          -H 'X-Atlassian-Token: nocheck' \
          -F 'file=@"image.png"' \
          -F 'minorEdit="true"' \
          -F 'comment="Example attachment comment"; type=image/png' \
          --basic --user '<userEmail>:<token>'
        

      Expected Results

      The image on the target page is correctly shown.

      Actual Results

      The result will be the following on the target page <site>/<space>/pages/402456577/DEVHELP-7212+-+Target+Page+1:

      • the image doesn’t show on the page
      • the attachments are on the page. Both of them are correct and can be loaded from the Attachments page.

      Workaround

      If a site is affected, the problem can be addressed by changing a feature flag setting.

      Please raise a ticket with the Atlassian customer support team at https://support.atlassian.com/contact/ and mention this ticket so that a support representative can update the relevant feature flag on the site.

      Attachments

        Issue Links

          Activity

            People

              bzivaljevic Bosko Zivaljevic (Inactive)
              ccurti Caterina Curti
              Votes:
              14 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: