[Catalyst] Patch for a possible HTML::Widget bug in $result->params()

Michele Beltrame mb at italpro.net
Fri Mar 24 16:35:17 CET 2006


Hello!

Using HTML::Widget I noticed that if in my result object I have
$result->{_params} such as this:

    'idimportance' => '1',
    'description' => undef,
    'ibegin' => '2006-03-24 10:00'
    'idtype' => [
        '3',
        '4'
    ]

by calling $result->params() I get this:

    'idimportance' => '1',
    'description' => undef,
    'ibegin' => '2006-03-24 10:00'
    'idtype' => 3

That is, in the case of multiple selects or checkboxes, I get only the
first value.

I looked into the HTML::Widget::Result.pm code and I notices that the
params() method calls param() to retrieve each valid parameter. The
problem is param(), in case of multiple values, does not return an
arrayref, but just an array, so the caller just stores the first one. I
created a patch, which I attach to this message, which solves the
problem. I don't know if it's right (that is, it doesn't break some
other things), but it seems to work. ;-)

Michele.

-- 
Michele Beltrame
http://www.varlogarthas.net/
ICQ# 76660101
Informativa privacy: http://www.italpro.net/em.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HTML-Widget-Result.pm.patch
Type: text/x-patch
Size: 419 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060324/8cd8158f/attachment.bin 


More information about the Catalyst mailing list