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

The attachment version and date coming from an input filter are not respected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 16.0.0
    • Filter, Old Core
    • None
    • Unknown

    Description

      When filtering an attachment, its revision date is unconditionally set to the current time and its version is wrongly incremented.

      Stack trace:

       

      setDate:509, XWikiAttachment (com.xpn.xwiki.doc)
      update:303, ListAttachmentArchive (com.xpn.xwiki.internal.doc)
      updateArchive:292, ListAttachmentArchive (com.xpn.xwiki.internal.doc)
      <init>:76, AttachmentArchiveSaveRunnable (org.xwiki.store.legacy.store.internal)
      getArchiveSaveRunnable:190, FilesystemAttachmentVersioningStore (org.xwiki.store.legacy.store.internal)
      <init>:317, FilesystemAttachmentStore$AttachmentSaveTransactionRunnable (org.xwiki.store.legacy.store.internal)
      getAttachmentContentSaveRunnable:156, FilesystemAttachmentStore (org.xwiki.store.legacy.store.internal)
      saveAttachmentContent:120, FilesystemAttachmentStore (org.xwiki.store.legacy.store.internal)
      saveAttachment:1968, XWikiHibernateStore (com.xpn.xwiki.store)
      saveAttachmentList:1901, XWikiHibernateStore (com.xpn.xwiki.store)
      saveXWikiDoc:618, XWikiHibernateStore (com.xpn.xwiki.store)
      saveXWikiDoc:255, XWikiCacheStore (com.xpn.xwiki.store)
      saveXWikiDoc:215, XWikiCacheStore (com.xpn.xwiki.store)
      saveDocument:2107, XWiki (com.xpn.xwiki)
      maybeSaveDocument:252, DocumentInstanceOutputFilterStream (com.xpn.xwiki.internal.filter.output)
      endWikiDocumentRevision:164, DocumentInstanceOutputFilterStream (com.xpn.xwiki.internal.filter.output)
      invoke:-1, GeneratedMethodAccessor127 (jdk.internal.reflect)
      invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect)
      invoke:568, Method (java.lang.reflect)
      invoke:90, FilterProxy (org.xwiki.filter.internal)
      invoke:75, CompositeFilter (org.xwiki.filter.internal)
      endWikiDocumentRevision:-1, $Proxy558 (jdk.proxy297)
      invoke:-1, GeneratedMethodAccessor127 (jdk.internal.reflect)
      invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect)
      invoke:568, Method (java.lang.reflect)
      invoke:90, FilterProxy (org.xwiki.filter.internal)
      invoke:75, CompositeFilter (org.xwiki.filter.internal)
      endWikiDocumentRevision:-1, $Proxy559 (jdk.proxy297)
      invoke:-1, GeneratedMethodAccessor127 (jdk.internal.reflect)
      invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect)
      invoke:568, Method (java.lang.reflect)
      invoke:90, FilterProxy (org.xwiki.filter.internal)
      invoke:63, FilterProxy (org.xwiki.filter.internal)
      endWikiDocumentRevision:-1, $Proxy560 (jdk.proxy297)
      readPageRevision:1383, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      sendRevisions:1249, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      sendTerminalDoc:1173, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      readPage:1141, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      sendPage:477, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      sendConfluenceRootSpace:450, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      sendSpaces:370, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      readInternal:340, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      read:184, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      read:96, ConfluenceInputFilterStream (org.xwiki.contrib.confluence.filter.internal.input)
      read:79, AbstractBeanInputFilterStream (org.xwiki.filter.input)
      runInternal:97, FilterStreamConverterJob (org.xwiki.filter.internal.job)
      runInContext:246, AbstractJob (org.xwiki.job)
      run:223, AbstractJob (org.xwiki.job)
      run:75, ScriptFilterStreamConverterJob (org.xwiki.filter.script.internal)
      runInternal:166, ConfluenceMigrationJob (com.xwiki.confluencepro.internal)
      runInContext:246, AbstractJob (org.xwiki.job)
      run:223, AbstractJob (org.xwiki.job)
      runWorker:1136, ThreadPoolExecutor (java.util.concurrent)
      run:635, ThreadPoolExecutor$Worker (java.util.concurrent)
      run:840, Thread (java.lang) 

      This happens for instance when importing the joined confluence package,  which has 1 document and several attachments, using either:

      • Confluence-XML package and The Filter Streams Converter application, setting the input type to "confluence+xml" and the source to the attached file
      • Confluence Migrator Pro

      The dirty flag doesn't seem to be correctly handled in this case.

       

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              rjakse Raphaël Jakse
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: