Date: | Fri, 3 Jun 2005 13:19:10 -0500 |
From: | Mark Stosberg <mark [...] summersault.com> |
To: | "Till, Jeff" <jatill [...] buffalo.edu> |
CC: | cascade-dataform [...] lists.sourceforge.net, bug-Data-FormValidator [...] rt.cpan.org |
Subject: | Re: [dfv] explicitly providing field name to param leaves value unfiltered. |
On Thu, Jun 02, 2005 at 08:46:43AM -0400, Till, Jeff wrote:
Show quoted text
> I have a field with a filter and 2 constraints. One constraint just
> accepts the $value of the param, while the other takes another
> parameter. Ex:
>
> validator_profile->{constraints} = {
>
> my_field => [
>
> 'reg_number_list',
>
> {
>
> constraint => 'combine_with_list',
>
> params => ['my_field', \'another param'],
>
> },
>
> ],
>
> The first constraint passed in the param filtered, but the second
> constraint got the param unfiltered. Is there a way to get the filtered
> param for both constraints?
I see what you are saying. The first constraint received the value
implicitly, and it was filtered.
The second constraint explicitly passed the name of field 'my_field',
and the corresponding value was /not/ filtered.
I agree the treatment is inconsistent and seems like a bug.
Would you be interested in writing a Test::More test case for it,
and/or submitting a patch to the code?
Otherwise I'll get it eventually.
The workaround would be get the value of 'my_field' and filter it
yourself, and then pass it to 'params' as an explicit value.
Mark
--
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Mark Stosberg Principal Developer
mark@summersault.com Summersault, LLC
765-939-9301 ext 202 database driven websites
. . . . . http://www.summersault.com/ . . . . . . . .