Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18346

Children of a terminal document with a dot in the name are not correctly identified upon rename

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 11.10.13
    • Old Core
    • None
    • Unknown

    Description

      Note: this issue concerns the documents using the deprecated document parent property, that was replaced by the location in new versions. However, the value remains stored in the database and the code that is using it should still work correctly.
      This property remains used, however, upon migration of older versions of XWiki and upon migration of other systems (for example, the confluence migrator uses it to transport the documents hierarchy to XWiki).

      How to reproduce:

      • create a terminal page with a dot in its name, in space A. For example, "Test . Dot"
      • create another terminal page in the same space, with its parent set to the first page. For example, the page could be called "Test child".
        • When the first page will be set as the parent of the second page and the parent reference is set as a relative reference, it will endup as "Test \. Dot" - so that the dot is not interpreted as a reference separator
      • Rename first page to "Test Dot", using the Document#rename API or the rename UI (so it also impacts the refactoring API).

      Expected result:

      • the parent of the second page is changed to "Test Dot" as well

      Actual result:

      • the parent of the second page is not changed to "Test Dot", remains "Test \. Dot"

      This does not reproduce if the parent reference is absolute (or local).

      The culprit is the function that is used to get the children of the renamed page when the refactoring is done upon rename, which is checking the exact name of the current document against the parent of potential children, when it would need to check a serialized reference version of the name of the current page against the parent field: https://github.com/xwiki/xwiki-platform/blob/8c612c64ca7fe1fbbbdb39180bed68d9699ad0c7/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java#L5527 .

      Attachments

        Activity

          People

            Unassigned Unassigned
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: