Skip Menu |
 

This queue is for tickets about the OpenFrame CPAN distribution.

Report information
The Basics
Id: 69077
Status: new
Priority: 0/
Queue: OpenFrame

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

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

Attachments
0001-Adapt-CGI-Cookie-construction-to-CGI-3.51-RT-69077.patch



Subject: OpenFrame::Cookies->new()->set() fails with CGI >= 3.51
Download (untitled) / with headers
text/plain 689b
Since CGI 3.51, CGI::Cookie->new() without key and value returns undef: Version 3.51, Jan 5, 2011 [BUG FIXES] - CGI::Cookie->new() now follows the documentation and returns undef if the -name and -value args aren't provided. This new behavior is also consistent with the docs and code of CGI::Simple::Cookie. (Mark Stosberg) This construction is used in lib/OpenFrame/Cookies.pm: my $cookie = OpenFrame::Cookie->new(); $cookie->name( $key ); and that causes dies Perl: $ perl -Ilib -MOpenFrame::Cookies -le 'my $cookie = OpenFrame::Cookies->new(); $cookie->set("a" => "b");' Can't call method "name" on an undefined value at lib/OpenFrame/Cookies.pm line 47.
From: ppisar [...] redhat.com
Download (untitled) / with headers
text/plain 807b
Dne Pá 24.čen.2011 08:58:56, ppisar napsal(a): Show quoted text
> Since CGI 3.51, CGI::Cookie->new() without key and value returns undef: > > Version 3.51, Jan 5, 2011 > [BUG FIXES] > - CGI::Cookie->new() now follows the documentation and returns undef > if the -name and -value args aren't provided. This new behavior is > also consistent with the docs and code of CGI::Simple::Cookie. > (Mark Stosberg) > > This construction is used in lib/OpenFrame/Cookies.pm: > > my $cookie = OpenFrame::Cookie->new(); > $cookie->name( $key ); > > and that causes dies Perl: > > $ perl -Ilib -MOpenFrame::Cookies -le 'my $cookie = > OpenFrame::Cookies->new(); $cookie->set("a" => "b");' > Can't call method "name" on an undefined value at > lib/OpenFrame/Cookies.pm line 47.
Proposed patch is attached.
Subject: 0001-Adapt-CGI-Cookie-construction-to-CGI-3.51-RT-69077.patch
From f6fea01379c50fa7d6dc1d981e3f7e11f9c19bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 24 Jun 2011 15:22:19 +0200 Subject: [PATCH] Adapt CGI::Cookie construction to CGI 3.51 (RT#69077) --- lib/OpenFrame/Cookies.pm | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/OpenFrame/Cookies.pm b/lib/OpenFrame/Cookies.pm index 7ee5379..7293a10 100644 --- a/lib/OpenFrame/Cookies.pm +++ b/lib/OpenFrame/Cookies.pm @@ -43,9 +43,10 @@ sub set { ## right, we have a key value pair that we need to turn ## into an OpenFrame::Cookie object - my $cookie = OpenFrame::Cookie->new(); - $cookie->name( $key ); - $cookie->value( [ $val ] ); + my $cookie = OpenFrame::Cookie->new( + -name => $key, + -value => [ $val ] + ); ## call this method again with the cookie as the parameter $self->set( $cookie ); -- 1.7.5.4


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.