Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the HTML-Widget CPAN distribution.

Report information
The Basics
Id: 25497
Status: open
Priority: 0/
Queue: HTML-Widget

People
Owner: Nobody in particular
Requestors: jshields-subscriptions [...] mechanicnet.com
Cc:
AdminCc:

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



X-Asg-Orig-Subj: In scalar context HTML::Widget::Result::param returns the first element of a parameter arrayref instead of the arrayref itself.
X-Barracuda-Connect: unknown[192.168.200.14]
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DK_POLICY_SIGNSOME
X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at mechanicnet.com
X-Asg-Whitelist: Sender
Received-SPF: pass (x1.develooper.com: local policy)
content-type: text/plain; charset="utf-8"; format="flowed"
Reply-To: jshields-subscriptions [...] mechanicnet.com
X-Asg-Debug-Id: 1174071408-15d600230000-0HzuJ8
X-Barracuda-Start-Time: 1174071408
Organization: MechanicNet Group, Inc.
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id A13644D82EF for <bug-HTML-Widget [...] rt.cpan.org>; Fri, 16 Mar 2007 19:27:59 -0400 (EDT)
Received: (qmail 31022 invoked by alias); 16 Mar 2007 23:27:58 -0000
Received: from mail.mechanicnet.com (HELO barracuda.mechanicnet.com) (64.124.80.242) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 16 Mar 2007 16:27:47 -0700
Received: from mechanicnet.com (unknown [192.168.200.14]) by barracuda.mechanicnet.com (Spam Firewall) with ESMTP id 76CDE3B2E3 for <bug-HTML-Widget [...] rt.cpan.org>; Fri, 16 Mar 2007 11:56:48 -0700 (PDT)
Received: from [127.0.0.1] [71.133.106.136] by mechanicnet.com with ESMTP (SMTPD32-8.12) id A88C8280078; Fri, 16 Mar 2007 10:57:16 -0800
Delivered-To: cpan-bug+html-widget [...] diesel.bestpractical.com
Subject: In scalar context HTML::Widget::Result::param returns the first element of a parameter arrayref instead of the arrayref itself.
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
Return-Path: <jshields [...] mechanicnet.com>
X-Original-To: bug-HTML-Widget [...] rt.cpan.org
X-Spam-Check-BY: la.mx.develooper.com
Date: Fri, 16 Mar 2007 11:56:39 -0700
X-Barracuda-Url: http://192.168.200.19:8000/cgi-bin/mark.cgi
Message-Id: <45FAE867.1050709 [...] mechanicnet.com>
To: bug-HTML-Widget [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: John Shields <jshields [...] mechanicnet.com>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 1336
Download (untitled) / with headers
text/plain 1.3k
In the method from HTML::Widget::Result below the documentation clearly states that calling the "param" method in scalar context for a multi-valued parameter will return an arrayref to the values. Currently the code returns the first value, not the arrayref itself. The fix is to change line 389 from: : $self->{_params}->{$param}->[0]; to : $self->{_params}->{$param}; Of course, this can be worked around by always using list context... Regards, John =head2 param Arguments: $name Return Value (scalar context): $value or \@values Return Value (list context): @values Returns valid parameters with a CGI.pm-compatible param method. (read-only) =cut sub param { my $self = shift; if ( @_ == 1 ) { my $param = shift; my $valid = $self->valid($param); if ( !$valid || ( !exists $self->{_params}->{$param} ) ) { return wantarray ? () : undef; } if ( ref $self->{_params}->{$param} eq 'ARRAY' ) { return (wantarray) ? @{ $self->{_params}->{$param} } : $self->{_params}->{$param}->[0]; } else { return (wantarray) ? ( $self->{_params}->{$param} ) : $self->{_params}->{$param}; } } return $self->valid; }
MIME-Version: 1.0
In-Reply-To: <45FAE867.1050709 [...] mechanicnet.com>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-14883-1175161239-808.25497-0-0 [...] rt.cpan.org>
References: <45FAE867.1050709 [...] mechanicnet.com>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 261
Download (untitled) / with headers
text/plain 261b
The method is supposed to be CGI.pm-compatible, so it's the documentation that's wrong, not the code. This isn't likely to get fixed until a new maintainer comes forward, see the note at http://search.cpan.org/~cfranks/HTML-Widget-1.11/lib/HTML/Widget.pm#NOTE


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.