Fix regression for relative uri_for arguments after a forward() introduced in 5.7013...
Brian Cassidy [Fri, 23 May 2008 14:54:22 +0000 (14:54 +0000)]
Changes
lib/Catalyst.pm
lib/Catalyst/Action.pm
lib/Catalyst/Runtime.pm
t/lib/TestApp/Controller/Action/Forward.pm
t/live_component_controller_action_forward.t

diff --git a/Changes b/Changes
index c1307f8..97b7dca 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+5.7014  ---
+        - Fix regression for relative uri_for arguments after a forward()
+          introduced in 5.7013 (Peter Karman)
+
 5.7013  2008-05-16 18:20:00
         - Provide backwards compatability methods in Catalyst::Stats
         - Fix subdirs for scripts that run in subdirs more than one level deep.
index 2bc2227..58472c6 100644 (file)
@@ -34,8 +34,6 @@ __PACKAGE__->mk_accessors(
     qw/counter request response state action stack namespace stats/
 );
 
-attributes->import( __PACKAGE__, \&namespace, 'lvalue' );
-
 sub depth { scalar @{ shift->stack || [] }; }
 
 # Laziness++
@@ -65,7 +63,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.7013';
+our $VERSION = '5.7014';
 
 sub import {
     my ( $class, @arguments ) = @_;
index 9ff1dca..7e828f0 100644 (file)
@@ -38,7 +38,6 @@ use overload (
 
 sub dispatch {    # Execute ourselves against a context
     my ( $self, $c ) = @_;
-    local $c->{namespace} = $self->namespace;
     return $c->execute( $self->class, $self );
 }
 
index 145d33e..1de1ba3 100644 (file)
@@ -7,7 +7,7 @@ BEGIN { require 5.008001; }
 
 # Remember to update this in Catalyst as well!
 
-our $VERSION='5.7013';
+our $VERSION='5.7014';
 
 =head1 NAME
 
index c6be731..e118d73 100644 (file)
@@ -85,4 +85,9 @@ sub class_forward_test_action : Local {
     $c->forward(qw/TestApp class_forward_test_method/);
 }
 
+sub forward_to_uri_check : Local {
+    my ( $self, $c ) = @_;
+    $c->forward( 'Action::ForwardTo', 'uri_check' );
+}
+
 1;
index d4e20f8..5aac25a 100644 (file)
@@ -10,7 +10,7 @@ our $iters;
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 47 * $iters;
+use Test::More tests => 50 * $iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -235,4 +235,15 @@ sub run_tests {
             'Test Method' );
     }
 
+    # test uri_for re r7385
+    {
+        ok( my $response = request(
+            'http://localhost/action/forward/forward_to_uri_check'),
+            'forward_to_uri_check request');
+
+        ok( $response->is_success, 'forward_to_uri_check successful');
+        is( $response->content, 'http://localhost/action/forward/foo/bar',
+             'forward_to_uri_check correct namespace');
+    }
+
 }