Tags:
create new tag
, view all tags
TWiki plugins authors have known for a long time that the mechanisms TWiki offers for ordering plugin execution are very basic. A quick review:
  1. By default, plugins are executed in alphabetical order
  2. If {PluginsOrder} is defined, the plugins defined therein are executed first, in the order they are declared in {PluginsOrder}. Other plugins are executed in alphabetic order after those from {PluginsOrder}
  3. A plugin may be added to the {PluginsOrder} order two or more times
  4. The same order applies to all handlers. So plugins A, B and C are executed in the beforeEditHandler in the order ABC, and in the afterEditHandler in the same order ABC.

While plugins have remained fairly simple, and the interactions between them low, this has not been a major issue. However with the advent of major content transformations during edits, this has become a much more important issue.

The specific case in question relates to the interaction of the WysiwygPlugin and the SectionalEditContrib+EditContrib. In this case the beforeEdit processing of the text requires the SectionalEditContrib to break the content into pre + text + post, and present just text to the editor. Just after that, the pre-processing of the WysiwygPlugin will convert text to HTML for editing. Clearly the afterEditHandler cannot simply replay the same order, otherwise the TML in pre and post will be concatenated to the HTML before conversion by the WysiwygPlugin. This specific problem can be coded around by restructuring the EditContrib to make correct use of an afterEditHandler, but the fact remains that the problem is at heart an architectural issue in TWiki, and will bite again in the future.

I'm not sure this problem is isolated to the beforeEditHandler / afterEditHandler cycle, but it certainly exists there, and suggests that a more sophisticated mechanism is required for ordering plugin execution.

Some possibilities:

  1. A simple mechanism, such as a separate {PluginsOrder} for each handler
  2. A more complex dynamic mechanism, where plugins are able to declare the plugins they must come before/after (dependencies)

See also: Bugs:Item5828, Bugs:Item5858

-- Contributors: CrawfordCurrie - 01 Aug 2008

Discussion

Topic revision: r1 - 2008-08-01 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.