NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item10345: FORMFIELD renders 'format' text with 'default' value as $value

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
If a form field is empty, FORMFIELD has a parameter default to set the default text. The documentation says: "Text shown if the field is defined in the topic, but the field value is empty". But something else happens:

Test on this topic (while field Component is left empty):

%FORMFIELD{
"Component"
format="Component: $value"
default="(no Component value given)"
alttext="field Component does not exist in topic form"
}%

renders as:

(no Component value given)

So the macro uses the value of default for $value. Which is unexpected and wrong according to the documentation.

What happens with a non-existent form field?

field Blo does not exist in topic form

Nothing wrong there.

-- ArthurClemens - 12 Feb 2011

 

ItemTemplate edit

Summary FORMFIELD renders 'format' text with 'default' value as $value
ReportedBy ArthurClemens
Codebase 1.1.2, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:10686 Foswikirev:10687 Foswikirev:10688 Foswikirev:10689
TargetRelease patch
ReleasedIn 1.1.3
Topic revision: r7 - 16 Apr 2011, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads