Feature Proposal: Make SaveAttachment not trigger TWiki::Plugins::dispatch
Motivation
Resolve DirectGraphPlugin's conflict issue with other plugins.
Description and Documentation
When viewing a page with a DirectGraphPlugin, DirectGraphPlugin's commonTagHandler invokes "TWiki::Store::saveAttachment" to attach generated image files to a topic, which triggers "beforeAttachmentSaveHandler" and "afterAttachmentSaveHandler". This might cause conflicts with plugins which handle "beforeAttachmentSaveHandler" and "afterAttachmentSaveHandler". To resolve this problem, dispatching these to handlers should be optional in "TWiki::Store::saveAttachment" subroutine.
Examples
Impact
Implementation
--
Contributors:
Yaojun Fei - 2013-05-27
Discussion
Not sure if disabling the callback is the right approach. This increases the complexity if the API.
What problems do you get if the DirectGraphPlugin attaches images via official API?
Possibly change the DirectGraphPlugin? The
ChartPlugin for example creates image files directly in the topic's attachment directory, without using the API.
--
Peter Thoeny - 2013-05-27
We have a
RTNotifyPlugin which notifys subscribed users of the changed topics. It handles afterAttachmentSaveHandler. And in that handler, it expands the target topic to retrieve the changes since its last version, which will invokes back to
DirectGraphHandler's commonTagHandler.
I agree with you that making it generate images in the same way as
ChartPlugin will resolve this issue in a more clean way.
--
Yaojun Fei - 2013-05-27
As discussed in
JerusalemReleaseMeeting2013x05x30, this feature is no longer needed because the custom plugin will generate image files directly, in a similar way like the
ChartPlugin.
--
Peter Thoeny - 2013-05-31