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

XWikiDocument.readObjectsFromFormUpdateOrCreate() creates duplicate objects when ids are non-continuous

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 13.10.1, 14.0-rc-1
    • 7.1-milestone-1
    • Old Core
    • None
    • Unit
    • Unknown
    • N/A
    • N/A
    • Pull Request accepted

    Description

      In contrast to its JavaDoc documentation, the method XWikiDocument.readObjectsFromFormUpdateOrCreate() does support ids that are non-continuous and doesn't ignore them (however, the URL documentation describes that they are supported). Instead, it adds these objects twice - once at the next free id and then again at the specified id. These are two references to the exactly same Java object so I think they might be de-duplicated again during serialization/unserialization and the object definitely won't be saved twice in the database so the impact on existing data should be limited.

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: