This queue is for tickets about the CHI CPAN distribution.

Report information
The Basics
Id:
95291
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
josh [...] ziprecruiter.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: CHI::Types using wrong parameter for DiscardPolicy
Date: Fri, 2 May 2014 11:07:50 -0700
To: bug-CHI@rt.cpan.org
From: Josh Rosenbaum <josh@ziprecruiter.com>
For CHI 0.58.

The attached patch fixes the DiscardPolicy type by using the correct parameter ($_[0]) rather than the $_ variable.

This bug is triggered when:
*) maximum size of cache is reached
and
*) $_ is a ref, but not a code ref.

I'm guessing it hasn't been noticed so far, because that set of conditions limits the scope of the issue for many cases.

--- /usr/local/share/perl/5.14.2/CHI/Types.pm   2013-07-21 07:22:39.000000000 -0700
+++ CHI/Types.pm        2014-05-02 10:44:33.300836594 -0700
@@ -37,7 +37,7 @@
 },
 {
     name => 'DiscardPolicy',
-    test => sub { !ref($_) || ref($_) eq 'CODE' },
+    test => sub { !ref($_[0]) || ref($_[0]) eq 'CODE' },
     message => sub { return exception_message($_[0], 'a coderef or policy name') },
     inflate => 0,
 },

Cheers,

-- Josh Rosenbaum


Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #95291] AutoReply: CHI::Types using wrong parameter for DiscardPolicy
Date: Mon, 5 May 2014 15:33:24 -0700
To: bug-CHI@rt.cpan.org
From: Josh Rosenbaum <josh@ziprecruiter.com>
Attached is the code that shows this being broken in 0.58.

-- Josh


On Fri, May 2, 2014 at 11:08 AM, Bugs in CHI via RT <bug-CHI@rt.cpan.org> wrote:
Show quoted text

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
        "CHI::Types using wrong parameter for DiscardPolicy",
a summary of which appears below.

There is no need to reply to this message right now.  Your ticket has been
assigned an ID of [rt.cpan.org #95291].  Your ticket is accessible
on the web at:

    https://rt.cpan.org/Ticket/Display.html?id=95291

Please include the string:

         [rt.cpan.org #95291]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                        Thank you,
                        bug-CHI@rt.cpan.org

-------------------------------------------------------------------------
For CHI 0.58.

The attached patch fixes the DiscardPolicy type by using the correct
parameter ($_[0]) rather than the $_ variable.

This bug is triggered when:
*) maximum size of cache is reached
and
*) $_ is a ref, but not a code ref.

I'm guessing it hasn't been noticed so far, because that set of conditions
limits the scope of the issue for many cases.

--- /usr/local/share/perl/5.14.2/CHI/Types.pm   2013-07-21
07:22:39.000000000 -0700
+++ CHI/Types.pm        2014-05-02 10:44:33.300836594 -0700
@@ -37,7 +37,7 @@
 },
 {
     name => 'DiscardPolicy',
-    test => sub { !ref($_) || ref($_) eq 'CODE' },
+    test => sub { !ref($_[0]) || ref($_[0]) eq 'CODE' },
     message => sub { return exception_message($_[0], 'a coderef or policy
name') },
     inflate => 0,
 },

Cheers,

-- Josh Rosenbaum

Message body is not shown because sender requested not to inline it.

Thanks, fixed in next release


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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