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

Drafts can't save attachments via insert option, with Collaborative Editing Off

    XMLWordPrintable

Details

    Description

      Summary

      With Collaborative Editing Off the following situation exists:

      • New drafts can't save attachments via upload attachment option.
      • Drafts of existing pages can save attachments, as usual.

      Steps to Reproduce

      1. Ensure Collaborative Editing is Off.
      2. Create a new page, give it a title and a few line.
      3. Select Close.
      4. From the profile picture navigate to Drafts.
      5. Open the draft for editing again.
      6. Upload attachment via Insert files and images option.

      Expected Results

      The attachment should upload to the draft.

      Actual Results

      The attachment pop-up never gives the option to Insert. The only option is to Close.

      Workaround

      Try one of the following two:

      1. Drag and Drop the attachment on to the editor.
      2. Enable Collaborative Editing.

      Diagnosis

      Confluence returns a 400 bad request to the request from the browser.

              "request": {
                "method": "GET",
                "url": "http://localhost:26101/c6101/rest/api/content/1376273/child/attachment?expand=version,container,space&_=1533779492837",
      .
      .
        "text": "{\"statusCode\":400,\"data\":{\"authorized\":false,\"valid\":true,\"allowedInReadOnlyMode\":true,\"errors\":[],\"successful\":false},\"message\":\"The entity Draft = { id: 1376273, type: page, title: saving a second draft, pageId: 0, pageVersion: 0} is not ContentConvertible or API available\",\"reason\":\"Bad Request\"}"
      

      The symptoms are similar to CONFSERVER-38719.

      If we try an upload again, we see the following error.

      In application logs, we see something like following.

      2018-08-09 12:32:55,098 WARN [http-nio-26101-exec-1] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
        ->[com.atlassian.confluence.api.impl.service.content.AttachmentServiceImpl$AttachmentFinderImpl.fetchMany]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly (Session #564908989)
       -- referer: http://localhost:26101/c6101/pages/createpage.action?useDraft=true&spaceKey=~admin&draftId=1376296& | url: /c6101/rest/api/content/1376296/child/attachment | traceId: 9bae05c239ca5de7 | userName: admin
      

      Additional Notes

      Upon testing this in Confluence v6.6.7, this issue doesn't happen. This version actually uses a different request method to upload attachments.

              "request": {
                "method": "GET",
                "url": "http://localhost:2667/c667/rest/prototype/1/content/1146888/attachments.json?_=1533780994036",
      

      Attachments

        Issue Links

          Activity

            People

              zzhou Zhenhuan Zhou (Inactive)
              haftab Hassan Aftab
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: