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

Setting the name of an object also changes its parent document reference

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.7 RC1, 2.6.1
    • 2.4 M2
    • None
    • None
    • Unknown

    Description

      Note that this is a WRONG usecase, objects should not be operated like this but, the following code:

      BaseObject object = document.getObject(objClass, objNumber);
      object.setName(newParentReference);
      

      has as side effect the change of the reference of document, since 2.4M2.

      namely

      document.getReference() 
      

      will be newParentReference on serialization.

      Before, all it was doing was to change the parent document of the object ("move" the object in another document), so, even if the usecase is deprecated, it should not have this side effect since it's breaking compatibility.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: