You are here: Foswiki>Tasks Web>Item5463 (15 Mar 2011, GeorgeClark)Edit Attach

Item5463: beforeAttachmentSave and afterAttachmentSave not triggered on attachment delete or move

Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: TopicAttachment, PluginHandlers
Reported By: TWiki:Main.MichelleHedstrom
Waiting For:
Last Change By: GeorgeClark
When writing a plugin, I noticed that the only time beforeAttachmentSaveHandler or afterAttachmentSaveHandler get triggered is when uploading a new attachment. On deleting or moving an attachment, neither of those get triggered, leaving no way for a plugin to capture that event.

1) You can probably use EmptyPlugin to test this - enable the beforeAttachmentSaveHandler and afterAttachmentSaveHandler functions, and enable debugging.

2) Pick any topic, and upload an attachment.

3) Look in the debug logs, and notice that both handlers triggered.

4) Delete the same attachment from the topic.

5) Look in the debug logs again, neither handler triggered.

-- TWiki:Main/MichelleHedstrom - 21 Mar 2008

this is really an enhancement request - I'm pretty certain that the handlers have never been triggered, so just adding them for attachments will probly kill many plugins.

instead, we should look at adding new handlers.

-- SvenDowideit - 25 Jun 2008

ItemTemplate edit

Summary beforeAttachmentSave and afterAttachmentSave not triggered on attachment delete or move
ReportedBy TWiki:Main.MichelleHedstrom
SVN Range TWiki-5.0.0, Sun, 09 Mar 2008, build 16496
AppliesTo Engine
Component TopicAttachment, PluginHandlers
Priority Enhancement
CurrentState Confirmed
TargetRelease n/a
ReleasedIn n/a
Topic revision: r3 - 15 Mar 2011, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy