1. This doesn't totally surprise me; my guess is that it's handled twice because the form definition is parsed both to create the form and to create the generated page (or something along those lines). It could be that checking one or more of the variables that's passed in to formHTML(), like $source_is_page, and calling or not calling the parse function based on that, would work.

2. This feature does make a good amount of sense (you probably mean "change" as opposed to "extension"); it would solve problems some people have had. If you do get it working, please send me the code you used.


On Mon, Aug 17, 2009 at 6:43 AM, Robert Michel <xologrim@hotmail.com> wrote:
I'm currently developing a form to collect bibliographic information from atlases and maps. For that I want each entry (==page) to have a property with an unique ID.
I've also wrote a parser function to generate such an ID (basically a counter whcih is counting up...): {{#uidgetnext:<name of id>}}. That way I can also have different counters.
Next I created a hidden field in a form:
{{{field|UID|hidden|default={{#uidgetnext:<name of id>}} }}}
I found out that the values passed as defaults a treated as plain text and are not evaluated by the parser. Therefore I changed SF_FormPrinter.inc a bit beginning Line 506 (in v1.8.1)
     } elseif ($sub_components[0] == 'default') {
          $default_value = $wgParser->recursiveTagParse($sub_components[1]);
          //$default_value = $sub_components[1];
2 questions:
1. This seems to work. When opening the form, the value gets set correctly. But when submitting the input, it seems this part of the code is called a 2nd time. (I only know because my counter is increased again...)
Any idea Why or Where?
2. this one is probably more for Yaron: Does an extension to the form processing like this make sense for you to include it in your code? I could imagine having a separate tag like "defaultparsed=..." to not confuse it with exsisting forms and to avoid to much parser invocation when it is not needed.
Robert Michel

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Semediawiki-user mailing list