From: Brian Cassidy Date: Fri, 23 May 2008 14:54:22 +0000 (+0000) Subject: Fix regression for relative uri_for arguments after a forward() introduced in 5.7013... X-Git-Tag: 5.7099_04~74 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4e69c1c8fe7754b8e208705c734991354c12b268 Fix regression for relative uri_for arguments after a forward() introduced in 5.7013 (Peter Karman) --- diff --git a/Changes b/Changes index c1307f8..97b7dca 100644 --- 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. diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 2bc2227..58472c6 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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 ) = @_; diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index 9ff1dca..7e828f0 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -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 ); } diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm index 145d33e..1de1ba3 100644 --- a/lib/Catalyst/Runtime.pm +++ b/lib/Catalyst/Runtime.pm @@ -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 diff --git a/t/lib/TestApp/Controller/Action/Forward.pm b/t/lib/TestApp/Controller/Action/Forward.pm index c6be731..e118d73 100644 --- a/t/lib/TestApp/Controller/Action/Forward.pm +++ b/t/lib/TestApp/Controller/Action/Forward.pm @@ -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; diff --git a/t/live_component_controller_action_forward.t b/t/live_component_controller_action_forward.t index d4e20f8..5aac25a 100644 --- a/t/live_component_controller_action_forward.t +++ b/t/live_component_controller_action_forward.t @@ -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'); + } + }