create new tag
, view all tags
http://TWiki.org/cgi-bin/view/Codev/FuncDotPm#expandCommonVariables_text_topic describes the expandCommonVariables function as " Expand all common %VARIABLES% ". This is not only insufficient, it is inaccurate. expandCommonVariables calls handleCommonTags, which expands:
  1. Preferences tags
  2. Internal tags (please, please, please let's get rid of these!)
  3. Include files
  4. TOC tags
All of which - with a considerable stretch of the imagination - could be classed as "Common Variables". However it also calls TWiki::Plugins::commonTagsHandler. Try as I might, I just can't perceive Plugins tags as "Common Variables".

Since I really, really want a function that really does just expand variables, nothing else, I propose that this bug is fixed by the splitting of this function into "expandVariables" - which would handle only preferences tags - and "expandCommonTags" which would do the rest, including plugins tags. In the interim, I am once again going to have to ignore the plugins API and call TWiki::Prefs::handlePreferencesTags and TWiki::handleInternalTags directly. expandCommonVariables should be maintained but deprecated.

Actually, I just realised that the function I require is the same function that has been begging to be abstracted from the edit and register- scripts for ages viz. a function that expands simple variables, such as DATE and TIME, on topic creation. The name suggested for this function was TWiki::expandVariablesOnTopicCreation, and I need it published to the plugins API. As well as the changes requested above.

-- CrawfordCurrie - 09 Mar 2004


Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-06-18 - MeredithLesly
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.