Re: Problem with Class::DBI::FromForm & Data::FormValidator

[prev] [thread] [next] [Date index for 2005/06/20]

From: Drew Taylor
Subject: Re: Problem with Class::DBI::FromForm & Data::FormValidator
Date: 20:27 on 20 Jun 2005
------=_Part_2471_28317525.1119299265867
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 6/20/05, Andy Grundman <andy@xxxxxxxxxx.xxx> wrote:
>=20
> Drew Taylor wrote:
> > (Crossposted to CDBI and DFV lists in the hope that someone has an=20
> answer)
> >
> > I'm trying to use Class::DBI::FromForm with a new application and am
> > running into consistent problems with the output from
> > D::FV::Results::valid(). The problem arises in
> > C::DBI::FromForm::_run_update(), specifically ~line 73:
> >
> > my $val =3D $results->valid($col);
> >
> > According to the docs, valid() returns a scalar in scalar context and a=
n
> > array in list context. The problem is that the scalar value being
> > returned is an array ref with a single value instead of the expected
> > scalar. This obviously causes problems when update() is called on my
> > CDBI object.
>=20
> This looks like it might be a DFV bug or bug in your application. I've
> never had any problems using FromForm 0.03 with DFV (in Catalyst).


I suspect a DFV bug myself because I can recreate it so easily. FromForm is=
=20
so dead simple it would be tough to have an error there. :-)

It doesn't look like your app does this, but FYI FromForm is not
> designed to be used if you have multiple values for any parameters
>=20

No multiple value parameters are used in this application.

Drew
--=20
----------------------------------------------------------------
Drew Taylor * Web development & consulting
Email: drew@xxxxxxxxxx.xxx * Site implementation & hosting
Web : www.drewtaylor.com <http://www.drewtaylor.com>; *=20
perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------

------=_Part_2471_28317525.1119299265867
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 6/20/05, <b class=3D"gmail_sendername">Andy Grundman</b> &lt;<a href=3D"=
mailto:andy@xxxxxxxxxx.xxx">andy@xxxxxxxxxx.xxx</a>&gt; wrote:<div><span cl=
ass=3D"gmail_quote"></span><blockquote class=3D"gmail_quote" style=3D"borde=
r-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-le=
ft: 1ex;">
Drew Taylor wrote:<br>&gt; (Crossposted to CDBI and DFV lists in the hope t=
hat someone has an answer)<br>&gt;<br>&gt; I'm trying to use Class::DBI::Fr=
omForm with a new application and am<br>&gt; running into consistent proble=
ms with the output from
<br>&gt; D::FV::Results::valid().&nbsp;&nbsp;The problem arises in<br>&gt; =
C::DBI::FromForm::_run_update(), specifically ~line 73:<br>&gt;<br>&gt;&nbs=
p;&nbsp; my $val =3D $results-&gt;valid($col);<br>&gt;<br>&gt; According to=
 the docs, valid() returns a scalar in scalar context and an
<br>&gt; array in list context. The problem is that the scalar value being<=
br>&gt; returned is an array ref with a single value instead of the expecte=
d<br>&gt; scalar. This obviously causes problems when update() is called on=
 my
<br>&gt; CDBI object.<br><br>This looks like it might be a DFV bug or bug i=
n your application.&nbsp;&nbsp;I've<br>never had any problems using FromFor=
m 0.03 with DFV (in Catalyst).</blockquote><div><br>
I suspect a DFV bug myself because I can recreate it so easily.
FromForm is so dead simple it would be tough to have an error there. :-)<br=
>
<br>
</div><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb=
(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It doesn't =
look like your app does this, but FYI FromForm is not<br>designed to be use=
d if you have multiple values for any parameters
<br></blockquote></div><br>
No multiple value parameters are used in this application.<br><br>Drew<br>-=
- <br>----------------------------------------------------------------<br>
Drew
Taylor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;Web development &amp; consulting<br> Email: <a href=3D"mailto:=
drew@xxxxxxxxxx.xxx">drew@xxxxxxxxxx.xxx</a>&nbsp;&nbsp;*&nbsp;&nbsp;Site i=
mplementation &amp; hosting<br> Web&nbsp;&nbsp;: <a href=3D"http://www.drew=
taylor.com">www.drewtaylor.com</a>&nbsp;&nbsp; *&nbsp;&nbsp;perl/mod_perl/D=
BI/mysql/postgres
<br> ----------------------------------------------------------------

------=_Part_2471_28317525.1119299265867--

Re: Problem with Class::DBI::FromForm & Data::FormValidator
Drew Taylor 20:27 on 20 Jun 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52