Skip Menu |

This queue is for tickets about the CGI-Application-Plugin-ValidateRM CPAN distribution.

Report information
The Basics
Id: 14383
Status: resolved
Priority: 0/
Queue: CGI-Application-Plugin-ValidateRM

People
Owner: Nobody in particular
Requestors: william [...] knowmad.com
Cc:
AdminCc:

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



Subject: DFV fails to validate profiles with file uploads - Can't coerce GLOB to string
Hi Mark, I'm seeing some odd behavior with DFV 4.01 and CAP::ValidateRM 2.00 on one of my systems when using a form that has enctype set to multipart/form-data. Basically whenever I try to get the $r->valid, I'm getting the following error when trying to pass the hasref into CGI::Uploader: "Use of uninitialized value in ref-to-glob cast at (eval 111) line 3." "Use of uninitialized value in hash element at (eval 111) line 3." If I do not set the enctype in the form, I do not see these errors but then CGI::Uploader can't handle the upload. If I try to dump $results->valid, I get a hash, not a hashref and sometimes (can't seem to pin this down) get the following error: "Error executing run mode 'upload_process': Can't coerce GLOB to string in entersub at /usr/lib/perl/5.8/Data/Dumper.pm line 158." It's very unusual behavior. Sorry to be so vague but I wanted to just capture these thoughts in case someone has seen or runs into this problem. Perl v5.8.4 Debian Linux (Testing) Profile = { required => [qw/rm/], optional => [ qw/file1 file2 file3 file4 file5/ ], } Thanks for any suggestions, William
Date: Wed, 31 Aug 2005 15:37:23 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Guest via RT <bug-CGI-Application-Plugin-ValidateRM [...] rt.cpan.org>
Subject: Re: [cpan #14383] DFV fails to validate profiles with file uploads - Can't coerce GLOB to string
RT-Send-Cc:
On Wed, Aug 31, 2005 at 04:23:54PM -0400, Guest via RT wrote: Show quoted text
> > "Use of uninitialized value in ref-to-glob cast at (eval 111) line 3." > "Use of uninitialized value in hash element at (eval 111) line 3."
What module is emitting these errors? Maybe Andy's trick can help you find out: http://use.perl.org/~petdance/journal/18179 Show quoted text
> "Error executing run mode 'upload_process': Can't coerce GLOB to string in entersub at /usr/lib/perl/5.8/Data/Dumper.pm line 158."
That looks like it might be an unrelated Data::Dumper issue. So far, it's not clear where the error is. I have used DFV and variants of CGI::Uploader in the past without a problem. Mark
From: william [...] knowmad.com
Hi Mark, Thanks for the helpful trick. I was able to track down the problem to instantiating CGI::Application twice in the instance script (note: this was not my code ;). The first time it was instantiated, CGI pulled the file off the incoming spool so that in the second instance when the script tried to use the uploaded file, it was not available. After figuring out the problem and only instantiating the module once, the upload worked just fine. Unfortunately, that one took longer to track down than I'd have liked. Thanks, William
Date: Tue, 6 Sep 2005 08:45:30 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Guest via RT <bug-CGI-Application-Plugin-ValidateRM [...] rt.cpan.org>
Subject: Re: [cpan #14383] DFV fails to validate profiles with file uploads - Can't coerce GLOB to string
RT-Send-Cc:
On Tue, Sep 06, 2005 at 09:39:15AM -0400, Guest via RT wrote: Show quoted text
> > After figuring out the problem and only instantiating the module once, > the upload worked just fine. Unfortunately, that one took longer to > track down than I'd have liked.
William, I ran into this issue years ago and also experienced much headache tracking it down. I think it happens any time CGI->new() is called twice a script, regardless of which module it happens in. In this sense, CGI::Application is helpful because if you always use $self->query(), this is avoided. (And don't call CGI::App's new() method twice. :) However, since the issue still persists years later, it should at least be better documented in CGI.pm, if not improved with a better diagnostic message or actually Working. Someone else who suspects the same issue with ValidateRM or DFV may appreciate this documentation that we've created at least. Mark