Skip Menu |

This queue is for tickets about the Data-FormValidator CPAN distribution.

Maintainer(s)' notes

This is the bug queue for Data::FormValidator.

Report information
The Basics
Id: 38102
Status: resolved
Priority: 0/
Queue: Data-FormValidator

People
Owner: Nobody in particular
Requestors: lhagemann [...] dyndns.com
Cc:
AdminCc:

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



Subject: Data::FormValidator::Results->get_filtered_data drops invalid values
Date: Fri, 1 Aug 2008 11:24:34 -0400
To: bug-Data-FormValidator [...] rt.cpan.org
From: Lisa Hagemann <lhagemann [...] dyndns.com>
reported for Data::FormValidator v4.61 observed similar behavior in v4.5 The Documentation reads: Data::FormValidator::filters -- "This is a reference to an array of filters that will be applied to ALL optional and required fields, before any constraints are applied." Data::FormValidator::Constraints->get_filtered_data -- "Returns the filtered data as a hashref, ..." I would expect then, that the get_filtered_data would return ALL fields. But in fact it only returns the filtered data for those filed that are valid. This may be FAD, and if so, the documentation should be updated to reflect such. A simple script below demonstrates the behavior: ------- #!/usr/bin/perl use warnings; use strict; use Data::FormValidator; use Data::Dumper; $Data::Dumper::Indent = 1; my $input = { 'f_name' => ' 2spaces_each ', 'l_name' => 'foobar', }; my $profile = { 'optional' => ['l_name'], 'required' => ['f_name'], 'filters' => ['trim'], }; my $dfv_results = Data::FormValidator->check($input, $profile); print Dumper($dfv_results->get_filtered_data, $dfv_results->invalid()); $profile->{'constraint_methods'} = { 'f_name' => qr/^\D$/, }; $dfv_results = Data::FormValidator->check($input, $profile); print Dumper($dfv_results->get_filtered_data, $dfv_results->invalid()); ------ Lisa L. Hagemann Application Developer Dynamic Network Services, Inc. http://www.dyndns.com | http://www.dynect.com
Subject: Re: [rt.cpan.org #38102] Data::FormValidator::Results->get_filtered_data drops invalid values
Date: Fri, 1 Aug 2008 11:37:28 -0400
To: bug-Data-FormValidator [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> This may be FAD, and if so, the documentation should be updated to > reflect such.
I'm not familiar with FAD in this context. I would lean towards updating the docs, for backwards compatibility, but if you feel strongly this is should work differently, you could gather other opinions on the mailing list to see if there is a community consensus about it. Thanks for the report! Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark Stosberg Principal Developer mark@summersault.com Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . .
I've patched the docs for the next release address this, with credit to you. Thanks for the report! Mark