At the moment if you specify both a formtemplate and a templatetopic in a save, then the form values in the query will
not be inserted into the newly created form. This makes it had for a
TWikiApplication that wants to create a topic from a template and populate the form in one hit. The relevant code fragment is in TWiki/UI/Save.pm:
# Expand field variables, unless this new page is templated
TWiki::Form::fieldVars2Meta( $webName, $query, $meta ) unless $templatetopi
Does anyone have any idea why this condition is there? I have removed it in DEVELOP, and everything works nicely, but it was presumably there for a reason. If it's good I can always put the condition back again.
--
CrawfordCurrie - 11 Mar 2005
I have also experimented in my installation with removing those lines. I think we need to document the algorithm of initialization of forms. As you know, forms can get values from
- URL parameters
- template topic
- form default values
In
FormValuesPassedInURLRequireText I have proposed the following order and priorities of intialization:
- If a value was passed in by a corresponding query parameter, that value should be taken, else
- If there is a templatetopic and there is a corresponding field value, that value should be taken, else
- If there is an initialization value defined in the formtemplate, that value should be taken, else
- The field value should be empty.
The patch at
FormValuesPassedInURLRequireText implements that algorithm and is in
DevelopBranch.
--
ThomasWeigert - 11 Mar 2005
I'm currently trying to figure out current status of direct-save feature (see notes in
SaveContentWithoutEditContinued) and have not been able to get the form template part of to work at all. I've even been able to find notes about how to use it. Specifically, I'm wondering what one is suppose to reference with
formtemplate=. The form definition topic? Thanks for any clarification.
--
LynnwoodBrown - 10 Jun 2005