Skip Menu |

This queue is for tickets about the HTML-Widget CPAN distribution.

Report information
The Basics
Id: 32539
Status: new
Priority: 0/
Queue: HTML-Widget

People
Owner: Nobody in particular
Requestors: mmcgillis [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.11
Fixed in: (no value)



When using HTML::Widget Filters for form fields that have no value the following errors are generated: Use of uninitialized value in substitution (s///) at /site/catalyst/default/lib/HTML/Widget/Filter/TrimEdges.pm line 27. Use of uninitialized value in substitution (s///) at /site/catalyst/default/lib/HTML/Widget/Filter/TrimEdges.pm line 28. Before passing a parameter value to the actual filter it should first be checked that it is defined. Inside HTML::Widget::Filter sub process { my ( $self, $params ) = @_; my @names = scalar @{ $self->names } ? @{ $self->names } : keys %$params; for my $name (@names) { my $values = $params->{$name}; if ( ref $values eq 'ARRAY' ) { $params->{$name} = [ map { $self->filter($_); } @$values ]; } else { $params->{$name} = $self->filter($values); } } } should be something like: sub process { my ( $self, $params ) = @_; my @names = scalar @{ $self->names } ? @{ $self->names } : keys %$params; for my $name (@names) { if (exists($params->{$name}) && defined($params->{$name})) { my $values = $params->{$name}; if ( ref $values eq 'ARRAY' ) { $params->{$name} = [ map { $self->filter($_); } @$values ]; } else { $params->{$name} = $self->filter($values); } } } }