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

Remote API rename feature should not allow duplicate titles

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.10.2
    • 2.10
    • None

    Description

      Confluence is supposed to enforce a unique page title per space rule, but the XML-RPC interface rename function doesn't enforce this rule. I haven't confirmed this but a user has reported it in 2.10.

      The rename workaround is undocumented but apparently already used by the Doc importer ( http://confluence.atlassian.com/display/DOC/Navigating+to+the+Doc+Import+Option ). It will split a Word document into multiple Confluence pages based on headings, but if there are two headings that are the same, it'll create two pages with the same name, and they'll be identified with a "pageId" instead of by the name.

      While you can't add a page with a duplicate name via XML-RPC, you can rename an existing page to a duplicate name. To reproduce:

      # create page 1
      page1 = {'content': 'some content', 'title': 'test', 'space': 'TEST'}
      res1 = xmlrpc.confluence1.storePage(token, page1)
      
      # try to create page 2 with same name, as sub page of page 1
      page2 = page1.copy()
      page2["parentId"] = res1["id"]
      # fails with com.atlassian.confluence.rpc.RemoteException:
      # The page you are trying to create already exists.
      
      # give it a unique name and create
      page2["title"] = 'test2'
      res2 = xmlrpc.confluence1.storePage(token, page2)
      
      # rename page 2 to same as page1 name
      res2["title"] = page1["title"]
      res2 = xmlrpc.confluence1.storePage(token, res2)
      

      Attachments

        Issue Links

          Activity

            People

              pcurren Paul Curren
              david.soul@atlassian.com David Soul [Atlassian]
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: