Item13520: FORMFIELD macro fails to return text in a format that can be rendered. Workaround available.
Priority: Urgent
Current State: Closed
Released In: 2.0.1
Target Release: patch
Applies To: Engine
Component: FORMFIELD
Branches: master
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