Item13520: FORMFIELD macro fails to return text in a format that can be rendered. Workaround available.

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.1
Target Release: patch
Applies To: Engine
Component: FORMFIELD
Branches: master
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
On Foswiki 1.1.9, the FORMFIELD macro would return text that was then properly rendered as TML. On Foswiki 2.0, the returned data renders as (mostly) raw.

Crawford found the issue. The underlying system is returning <br> instead of $n newline, which breaks the TML.

Workaround, For in-topic references, replace FORMFIELD with QUERY.

%QUERY{"Somefield"}%
%QUERY{"'Someweb.SomeTopic'/fields[name='Somefield'].value"}%
%SEARCH{"Somefield" type="query" web="web" topic="topic" newline="$n" format="$formfield(Somefield)"}%

-- GeorgeClark - 13 Jul 2015
diff --git a/core/lib/Foswiki/Macros/FORMFIELD.pm b/core/lib/Foswiki/Macros/FORMFIELD.pm
index c1fa840..4fb4323 100644
--- a/core/lib/Foswiki/Macros/FORMFIELD.pm
+++ b/core/lib/Foswiki/Macros/FORMFIELD.pm
@@ -87,7 +87,8 @@ sub FORMFIELD {
             $name, $format,
             {
                 showhidden => 1,
-                usetitle   => $field->{title}
+                usetitle   => $field->{title},
+                newline => '$n'
             }
         );
         $text = $default unless length($text);
-- Main.CrawfordCurrie - 13 Jul 2015 - 16:43
 

ItemTemplate edit

Summary FORMFIELD macro fails to return text in a format that can be rendered. Workaround available.
ReportedBy GeorgeClark
Codebase 2.0.0
SVN Range
AppliesTo Engine
Component FORMFIELD
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:5e785ef971bd
TargetRelease patch
ReleasedIn 2.0.1
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:5e785ef971bd
ItemBranchCheckins
Release01x01Checkins
Topic revision: r5 - 03 Aug 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy