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: 5445
Status: resolved
Priority: 0/
Queue: Data-FormValidator

People
Owner: Nobody in particular
Requestors: drew [...] drewtaylor.com
Cc:
AdminCc:

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



Subject: failure using object for data to check()
First, the code that was failing: my $q = $self->query; # CGI object via CGI::Application my $profile = {required=>[qw(note)]}; my $dfv = Data::FormValidator->new({}, $self->param('dfv_defaults') ); my $r = $dfv->check($q, $profile); The problem I'm experiencing is that only occasionally do this actually work! :-) The validation succeeded, but yet the required field ("note") was blank. When I passed a hashref of data to check({$q->Vars}) it worked 100%. I didn't debug within D::FV::Results, but it seems as if the CGI object data was not getting populated. I want to say I'm really looking forward to using this module! The built-in functionality is super, and customization looks pretty easy. I've got the glue completed in my CGI::Application super class (based on CGI::Application::ValidateRM) so using it going forward should be a breeze. Versions: Data::FormValidator: 3.50 CGI.pm: 2.77 perl 5.005_003 Apache/1.3.22 mod_perl/1.26 Linux 2.2.14-5.0smp #1 SMP
Date: Wed, 25 Feb 2004 22:41:18 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Guest via RT <bug-Data-FormValidator [...] rt.cpan.org>
Subject: Re: [cpan #5445] failure using object for data to check()
RT-Send-Cc:
On Wed, Feb 25, 2004 at 01:54:19PM -0500, Guest via RT wrote: Show quoted text
> > This message about Data-FormValidator was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=5445 > > > First, the code that was failing: > > my $q = $self->query; # CGI object via CGI::Application > my $profile = {required=>[qw(note)]}; > my $dfv = Data::FormValidator->new({}, $self->param('dfv_defaults') ); > my $r = $dfv->check($q, $profile); > > The problem I'm experiencing is that only occasionally do this actually work! :-) The validation succeeded, but yet the required field ("note") was blank. When I passed a hashref of data to check({$q->Vars}) it worked 100%. I didn't debug within D::FV::Results, but it seems as if the CGI object data was not getting populated. > > I want to say I'm really looking forward to using this module! The built-in functionality is super, and customization looks pretty easy. I've got the glue completed in my CGI::Application super class (based on CGI::Application::ValidateRM) so using it going forward should be a breeze. >
Could you see if this fixes it for you? http://mark.stosberg.com/Data-FormValidator-3.51_1.tar.gz There's a couple new test cases for this in the t/17* test. It seems the issue is not mod_perl specific. However, something is happening in that environment so that the CGI object is altered slightly after the first request, triggering the behavior. If you start your modperl server with -X (good for debugging, not production), it should be triggered after loading and re-loading the page once. Show quoted text
> CGI.pm: 2.77
It looks like there are some other modperl enhancements since this version. You might consider upgrading. Show quoted text
> perl 5.005_003
Wow. I'm surprised DFV works at all with Perll 5.5. :) Mark -- http://mark.stosberg.com/
From: Drew Taylor
[mark@summersault.com - Wed Feb 25 22:41:23 2004]: Show quoted text
> Could you see if this fixes it for you? > > http://mark.stosberg.com/Data-FormValidator-3.51_1.tar.gz
BTW, this fixes the problem I had earlier. You can close this ticket.