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

Backwards compatibility issue with setting the same attachment list to a document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.3
    • 4.3-milestone-2
    • Old Core
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      The recent changes introduced by XWIKI-8398 no longer allow a caller to do something like

      doc.setAttachmentList(doc.getAttachmentList())

      If you consider that before the setter, the caller would add some attachments to the list, this makes it impossible to reuse the list returned by the getter.

      Some code, like the xmldoc-update-plugin is now failing because it reuses the list returned by the getter and is now, practically, only clearing the attachment list instead of setting new attachments.

      A simple solution is to check in the setter if the new list is the same instance as the internal one and, if so, do nothing, because the list was already modified externally.

      Attachments

        Issue Links

          Activity

            People

              enygma Eduard Moraru
              enygma Eduard Moraru
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: