Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13520: Formfield failing to render
Solution found by CrawfordCurrie.
  • Loading branch information
gac410 committed Jul 13, 2015
1 parent 384cbd1 commit 5e785ef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions UnitTestContrib/test/unit/Fn_FORMFIELD.pm
Expand Up @@ -30,6 +30,7 @@ sub _createTopic {
| Marjorie | text | 30 |
| Priscilla | text | 30 |
| Daphne | text | 30 |
| Summary | textarea | 100 |
FORM
$formTopicObject->save();
$formTopicObject->finish();
Expand All @@ -41,6 +42,13 @@ FORM
{ name => "Priscilla", title => "String", value => "" } );
$topicObject->putKeyed( 'FIELD',
{ name => "Daphne", title => "String", value => "<nop>ElleBelle" } );
$topicObject->putKeyed( 'FIELD',
{ name => "Summary", title => "Area", value => <<DONE} );
---++!! Highlights of this release
* Major new Foswiki release
* Hundreds enhancements relative to 1.1.9
DONE
$topicObject->save();
}
Expand All @@ -60,6 +68,19 @@ sub test_FORMFIELD_byname {
$this->assert_str_equals( '99', $result );
}
sub test_FORMFIELD_Item13520 {
my $this = shift;
my ($topicObject) = $this->{test_topicObject};
my $result = $topicObject->expandMacros('%FORMFIELD{"Summary"}%');
$this->assert_str_equals( <<DONE, $result );
---++!! Highlights of this release
* Major new Foswiki release
* Hundreds enhancements relative to 1.1.9
DONE
}
# default="..." Text shown when no value is defined for the field
sub test_FORMFIELD_default {
my $this = shift;
Expand Down
3 changes: 2 additions & 1 deletion core/lib/Foswiki/Macros/FORMFIELD.pm
Expand Up @@ -87,7 +87,8 @@ sub FORMFIELD {
$name, $format,
{
showhidden => 1,
usetitle => $field->{title}
usetitle => $field->{title},
newline => '$n'
}
);
$text = $default unless length($text);
Expand Down

0 comments on commit 5e785ef

Please sign in to comment.