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

Content creation using REST API should fail when ancestor page is in trash

    XMLWordPrintable

Details

    Description

      Summary

      When creating content from REST API, you are required to pass an ancestor ID to specify where this page is created

      Steps to Reproduce

      1. Login to Confluence
      2. Create a new page Test Page 1
      3. Get the ID of the page (you can edit the page and get it from the URL, or from the head section in the HTML source)
      4. Delete Test Page 1
      5. Don't clear the trash
      6. Use the following CURL to create a page using REST API
        curl -u admin:admin -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"MySecondPage", "ancestors":[{"id":"11111112"}], "space":{"key":"TEST"},"body":{"storage":{"value":"<p>This is a new subpage</p>","representation":"storage"}}}' http://localhost:8090/confluence/rest/api/content/ | python -mjson.tool
        

      Expected Results

      The page should not be created and should tell the user that the ancestor page doesn't exist

      Actual Results

      1. Page is successfully created
      2. Page is not visible in the page tree under the Space home
      3. Page becomes a new root next to the Space home

      Please note that having multiple root pages will introduce a performance impact on content creation (from the UI as well as from the REST API)

      Workaround

      1. The workaround is to restore the page Test Page 1 from the trash and move both under the Space home.
      2. Restore Test Page 1 before creating the new page using REST API

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rslaiby Rudy Slaiby
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: