Foswiki on GitHub is open for business! Next release meeting: Monday October 13, 1300Z

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 distro:524378f401a2 distro:0adaa40563e2 distro:e2be352d22ed distro:b452f4a09254
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 License