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

People
Owner: MARKSTOS [...] cpan.org
Requestors: james [...] pcxperience.com
Cc:
AdminCc:

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



Subject: $result->valid("multi-select") is not returning an array ref
I've been using the D::FV modules in the HTMLObject::Form module I'm working on (http://htmlobject.sf.net/) and have noticed an issue that has occured recently after updating to the latest version(s) of D::FV that Debian testing provides. The issue is I'm selecting multiple entries in a multi-select select box and after fixing up the input hash to be an array ref, when I call the $results->valid("color2") it is not returning an array ref of all the selected items, but instead returns the first selected item only. I'm currently using version 3.54 of D::FV, perl 5.8.3, Debian testing. The HTMLObject::Form code is not currently released yet, but you can get it from the unstable debian repository at http://www.pcxperience.org/index.html#debian-apt. Version 2.18-11 is the latest release candidate. I have a form.cgi script in the examples directory which is testing this, though the HTMLObject::Form::validate() method will need to be re-modified to take the valid values from the result object. To work around this issue, I'm having to use the value from my input hash instead of the $result->valid("color2"); value. I haven't been able to tell from the documentation, but is it possible for the input value to be modified by the check() method and thus have a different value be returned when calling valid()? If not, then my workaround is ok, but if you can get a different value, then this is a major issue. :)
Date: Wed, 21 Apr 2004 13:10:24 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Guest via RT <bug-Data-FormValidator [...] rt.cpan.org>
CC: "Data::FormValidator list" <cascade-dataform [...] lists.sourceforge.net>
Subject: Re: [cpan #6089] $result->valid("multi-select") is not returning an array ref
RT-Send-Cc:
On Wed, Apr 21, 2004 at 01:04:25PM -0400, Guest via RT wrote: Show quoted text
> > I've been using the D::FV modules in the HTMLObject::Form module I'm > working on (http://htmlobject.sf.net/) and have noticed an issue that > has occured recently after updating to the latest version(s) of D::FV > that Debian testing provides. > > The issue is I'm selecting multiple entries in a multi-select select > box and after fixing up the input hash to be an array ref, when I call > the $results->valid("color2") it is not returning an array ref of all > the selected items, but instead returns the first selected item only. > > I'm currently using version 3.54 of D::FV, perl 5.8.3, Debian testing.
This does sound like a bug. I'll look into it some more. If you have a specific test case of something that used to work and quit working, that would be great. Show quoted text
> I haven't been able to tell from the documentation, but is it possible > for the input value to be modified by the check() method and thus have > a different value be returned when calling valid()? If not, then my > workaround is ok, but if you can get a different value, then this is a > major issue. :)
As a policy, the input data shouldn't be modified. However, what is returned via "valid()" can be different from the input due to filters being applied. Mark
No further response from requestor. It appears the change in behavior was generally for the better, and thus not a bug to fix.
From: kyaakone [...] yahoo.com
[mark@summersault.com - Wed Apr 21 14:10:18 2004]: Show quoted text
> > As a policy, the input data shouldn't be modified. However, what is > returned via "valid()" can be different from the input due to filters > being > applied. > > Mark
Also, if the data was missing and the 'defaults' are set. If $results->valid('foo') doesn't return an array, then a 'defaults' value that is set to an array wouldn't be honored.
From: mark [...] summersault.com
On Wed Apr 21 13:04:25 2004, guest wrote: Show quoted text
> I've been using the D::FV modules in the HTMLObject::Form module I'm > working on (http://htmlobject.sf.net/) and have noticed an issue > that has occured recently after updating to the latest version(s) > of D::FV that Debian testing provides. > > The issue is I'm selecting multiple entries in a multi-select select > box and after fixing up the input hash to be an array ref, when I > call the $results->valid("color2") it is not returning an array ref > of all the selected items, but instead returns the first selected > item only. > > I'm currently using version 3.54 of D::FV, perl 5.8.3, Debian testing. > > The HTMLObject::Form code is not currently released yet, but you can > get it from the unstable debian repository at > http://www.pcxperience.org/index.html#debian-apt. Version 2.18-11 > is the latest release candidate. I have a form.cgi script in the > examples directory which is testing this, though the > HTMLObject::Form::validate() method will need to be re-modified to > take the valid values from the result object. > > > To work around this issue, I'm having to use the value from my input > hash instead of the $result->valid("color2"); value. > > I haven't been able to tell from the documentation, but is it possible > for the input value to be modified by the check() method and thus > have a different value be returned when calling valid()? If not, > then my workaround is ok, but if you can get a different value, > then this is a major issue. :)
I'll be closing this bug within a few days unless a failing Test::More style case is provided which illustrates. The test should fail against the latest version of DFV, currently 4.14. Looking at t/25_results.t, we already have tests to insure that multi-valued input is returned correctly. Mark
No further feedback. Resolving, for reasons cited previously in the ticket.