You are here: Foswiki>Tasks Web>Item11908 (05 Jul 2015, GeorgeClark)Edit Attach

Item11908: Foswiki::Form doesn't cope with undefined values very well

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: FoswikiForm
Branches: trunk
Reported By: PaulHarvey
Waiting For:
Last Change By: GeorgeClark
Scenario:
  • Edit a topic with newly defined formfields

diff --git a/lib/Foswiki/Form/Select.pm b/lib/Foswiki/Form/Select.pm
index 98fc5a8..adeaa6f 100644
--- a/lib/Foswiki/Form/Select.pm
+++ b/lib/Foswiki/Form/Select.pm
@@ -124,6 +124,7 @@ sub renderForEdit {
 
     my $choices = '';
 
+    $value = defined $value ? $value : '';
     my %isSelected = map { $_ => 1 } split( /\s*,\s*/, $value );
     foreach my $item ( @{ $this->getOptions() } ) {
         my $option = $item

-- PaulHarvey - 30 May 2012

I'm wondering if this is related to Item11666

-- PaulHarvey - 13 Jun 2012

I've reverted my patch and will watch out for this error reoccuring.

-- PaulHarvey - 13 Jun 2012
 

ItemTemplate edit

Summary Foswiki::Form doesn't cope with undefined values very well
ReportedBy PaulHarvey
Codebase trunk
SVN Range
AppliesTo Engine
Component FoswikiForm
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:e496fd08ae26
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches trunk
trunkCheckins distro:e496fd08ae26
Release01x01Checkins
Topic revision: r6 - 05 Jul 2015, GeorgeClark - This page was cached on 28 May 2016 - 22:50.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License