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

Deleting an attachment should send an event

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      vmassol
      hmm strange it's as if we don't have an event sent when we remove an attachment
      I don't get a wartchlist email when I remove an attachment
      while I do get an email when i add one
      is this know?
      *known
      5:42
      tmortagne
      vmassol: that would mean we don't modify the XWikiDocument when we remove an attachment

      5:42
      vmassol
      (it could also be that the watchlist doesn't handle attachment deletion)
      tmortagne: indeed that's possible, haven't checked code

      5:43
      tmortagne
      what's in the watchlist is what's in messagestream AFAIK

      5:43
      vmassol
      indeed jus t checked
      and deleteAttachment in XWikiDocument
      doesn't change the doc
      just accees the attachment store
      and deleteXWikiAttachment in the attachmentstore doesn't send events

      5:44
      tmortagne
      yep like all stores
      all attachment events are produced based on document events right now AFAIK
      like object events

      5:45
      vmassol
      wait

      5:45
      cjd
      shouldn't it trigger a document save event since it causes the document to be resaved?

      5:45
      vmassol
      parentUpdate is true I think
      and that should do a : context.getWiki().getStore().saveXWikiDoc(attachment.getDoc(), context, false);

      5:46
      tmortagne
      so no event

      5:46
      vmassol
      indeed no event

      5:46
      tmortagne
      since it does not go trough XWiki#saveDocument

      5:46
      vmassol
      right
      I'll create a jira issue
      we do have an AttachmentDeletedEvent class though
      checking where it's used
      5:47
      tmortagne
      vmassol: (05:45:05 PM) tmortagne: all attachment events are produced based on document events right now AFAIK

      5:48
      tmortagne
      AttachmentEventGeneratorListener

      5:48
      vmassol
      yep just seen the code
      it's used in few places: activtiystreamimpl, lucene
      5:48
      just to listen to it

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: