Index: C:/Inetpub/twiki/lib/TWiki/UI/Edit.pm =================================================================== --- C:/Inetpub/twiki/lib/TWiki/UI/Edit.pm (revision 1581) +++ C:/Inetpub/twiki/lib/TWiki/UI/Edit.pm (revision 1582) @@ -62,6 +62,8 @@ my $theParent = $query->param( 'topicparent' ) || ""; my $ptext = $query->param( 'text' ); + my $newFormForTopic = $formTemplate ne ""; + return unless TWiki::UI::webExists( $webName, $topic ); return if TWiki::UI::isMirror( $webName, $topic ); @@ -215,7 +217,7 @@ TWiki::UI::oops( $webName, $topic, "noformdef" ); return; } - my $formText = &TWiki::Form::renderForEdit( $webName, $topic, $form, $meta, $query, @fieldDefs ); + my $formText = &TWiki::Form::renderForEdit( $webName, $topic, $form, $meta, $query, $newFormForTopic, @fieldDefs ); $tmpl =~ s/%FORMFIELDS%/$formText/go; } elsif( $saveCmd ne "repRev" && TWiki::Prefs::getPreferencesValue( "WEBFORMS", $webName )) { $form = '
| ' Index: C:/Inetpub/twiki/lib/TWiki/Form.pm =================================================================== --- C:/Inetpub/twiki/lib/TWiki/Form.pm (revision 1581) +++ C:/Inetpub/twiki/lib/TWiki/Form.pm (revision 1582) @@ -286,7 +286,7 @@ # Render form information =pod ----++ sub renderForEdit ( $web, $topic, $form, $meta, $query, @fieldsInfo ) +---++ sub renderForEdit ( $web, $topic, $form, $meta, $query, $newFormForTopic, @fieldsInfo ) Not yet documented. @@ -294,7 +294,7 @@ sub renderForEdit { - my( $web, $topic, $form, $meta, $query, @fieldsInfo ) = @_; + my( $web, $topic, $form, $meta, $query, $newFormForTopic, @fieldsInfo ) = @_; my $chooseForm = ""; if( TWiki::Prefs::getPreferencesValue( "WEBFORMS", "$web" ) ) { @@ -323,6 +323,10 @@ # Allow initialisation based on a preference $value = &TWiki::Prefs::getPreferencesValue($fieldName); } + if( ($newFormForTopic)) { + my $tmp = $fieldInfo[0] || ""; + $value = &TWiki::handleCommonTags( $tmp, $topic ); + } $value = "" unless defined $value; # allow "0" values my $extra = ""; |