CGI::FormBuilder::Source::File Bug

30 views
Skip to first unread message

monkey

unread,
Jan 5, 2010, 9:57:22 AM1/5/10
to perl-formbuilder
I was using the CGI::FormBuilder::Source::File part to create my
forms, however when I had a one value checkbox entry I was getting
incorrect behavior. For example with this type of entry:

cb_input:
type: checkbox
name: Option
options: active=Have this item active

I would get two checkboxes instead of one. one called 'active' and the
other 'Have this item active'. I tracked this down to what looks like
a problem with the C::F::S::File.pm file that splits the options
apart. here is the patch that I did to solve the issue. Let me know if
there is a better way to do this or if this patch is unnecessary.

--- File.pm 2010-01-05 09:55:40.000000000 -0500
+++ CGI/FormBuilder/Source/File.pm 2010-01-05 09:55:43.000000000 -0500
@@ -166,7 +166,7 @@
$ptr->{$term} = (ref $ptr->{$term})
? [ @{$ptr->{$term}}, @val ] :
@val > 1 ? \@val : $val[0];
} else {
- $ptr->{$term} = @val > 1 ? \@val : $val[0];
+ $ptr->{$term} = @val > 1 ? \@val : ref($val[0]) eq
'ARRAY' ? \@val : $val[0];
}
$inval = 1;
} else {

Derek Wueppelmann

unread,
Mar 18, 2010, 9:40:27 AM3/18/10
to perl-for...@googlegroups.com
On Tue, 2010-01-05 at 06:57 -0800, monkey wrote:
> I was using the CGI::FormBuilder::Source::File part to create my
> forms, however when I had a one value checkbox entry I was getting
> incorrect behavior. For example with this type of entry:
>
> cb_input:
> type: checkbox
> name: Option
> options: active=Have this item active
>
> I would get two checkboxes instead of one. one called 'active' and the
> other 'Have this item active'. I tracked this down to what looks like
> a problem with the C::F::S::File.pm file that splits the options
> apart. here is the patch that I did to solve the issue. Let me know if
> there is a better way to do this or if this patch is unnecessary.

Has anybody taken a look at my patch above? I posted this a while ago
and I have seen no replies to it yet.

--
o) Derek Wueppelmann (o
(D . dwue...@gmail.com D).
((` http://www.monkeynet.ca ( ) `


Dimuse

unread,
Jun 16, 2014, 7:37:39 PM6/16/14
to perl-for...@googlegroups.com, dwue...@gmail.com
i found same mistake

вторник, 5 января 2010 г., 18:57:22 UTC+4 пользователь monkey написал:

Mark Hedges

unread,
Jun 16, 2014, 7:46:39 PM6/16/14
to perl-for...@googlegroups.com, dwue...@gmail.com

Please feel free to take over this module and upload a new version. HTH. -Mark

--
You received this message because you are subscribed to the Google Groups "perl-formbuilder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to perl-formbuild...@googlegroups.com.
To post to this group, send email to perl-for...@googlegroups.com.
Visit this group at http://groups.google.com/group/perl-formbuilder.
For more options, visit https://groups.google.com/d/optout.

Dimuse

unread,
Jun 16, 2014, 7:51:59 PM6/16/14
to perl-for...@googlegroups.com, dwue...@gmail.com
and I fix it with you patch, many thanks
Reply all
Reply to author
Forward
0 new messages