Merge 'trunk' into 'param_filtering'
Tomas Doran [Sat, 6 Mar 2010 20:29:47 +0000 (20:29 +0000)]
r13036@t0mlaptop (orig r13000):  t0m | 2010-03-03 22:57:24 +0000
The no warnings stanza does nothing, so remove it
r13037@t0mlaptop (orig r13001):  t0m | 2010-03-03 23:03:13 +0000
Bump versions, expand somewhat on the changelog
r13045@t0mlaptop (orig r13009):  hobbs | 2010-03-05 02:16:07 +0000
Tiny doc fix for Engine::FastCGI

r13046@t0mlaptop (orig r13010):  matthewt | 2010-03-05 03:36:57 +0000
fix Index uri_for_action bug

Changes
Makefile.PL
lib/Catalyst.pm
lib/Catalyst/DispatchType/Index.pm
lib/Catalyst/Engine/FastCGI.pm
lib/Catalyst/Runtime.pm
t/aggregate/unit_core_uri_for.t
t/aggregate/unit_core_uri_for_action.t

diff --git a/Changes b/Changes
index de9104c..3cd68f6 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,7 +1,14 @@
 # This file documents the revision history for Perl extension Catalyst.
 
   Bug fixed:
-   - uri_for will now escape unsafe chars in captures and encode utf8 chars
+    - DispatchType::Index's uri_for_action only returns for actions registered
+      with it (prevents 'index :Path' or similar resolving to the wrong URI)
+
+5.80021 2010-03-03 23:02:01
+
+  Bug fixed:
+   - $c->uri_for will now escape unsafe characterss in captures
+     ($c->request->captures) and correctly encode utf8 charracters.
 
 5.80020 2010-02-04 06:51:18
 
index b5eac5f..568ea2c 100644 (file)
@@ -1,14 +1,12 @@
 use strict;
 use warnings;
 use inc::Module::Install 0.91;
-{   # Ensure that these get used - yes, M::I loads them for us, but if you're
-    # in author mode and don't have them installed, then the error is tres
-    # cryptic.
-    no warnings 'redefine';
-    use Module::Install::AuthorRequires;
-    use Module::Install::CheckConflicts;
-    use Module::Install::AuthorTests;
-}
+# Ensure that these get used - yes, M::I loads them for us, but if you're
+# in author mode and don't have them installed, then the error is tres
+# cryptic.
+use Module::Install::AuthorRequires;
+use Module::Install::CheckConflicts;
+use Module::Install::AuthorTests;
 
 perl_version '5.008004';
 
index 4166359..3c7dd25 100644 (file)
@@ -78,7 +78,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.80020';
+our $VERSION = '5.80021';
 our $PRETTY_VERSION = $VERSION;
 
 $VERSION = eval $VERSION;
index c0be9e6..6bad124 100644 (file)
@@ -67,7 +67,7 @@ Register an action with this DispatchType.
 sub register {
     my ( $self, $c, $action ) = @_;
 
-    $self->_actions->{ $action->reverse } = $action;
+    $self->_actions->{ $action->reverse } = $action if $action->name eq 'index';
 
     return 1;
 }
@@ -84,7 +84,7 @@ sub uri_for_action {
 
     return undef if @$captures;
 
-    return undef unless $action->name eq 'index';
+    return undef unless exists $self->_actions->{ $action->reverse };
 
     return "/".$action->namespace;
 }
index 9f7dfb2..96b75df 100644 (file)
@@ -297,7 +297,7 @@ static, and dynamic.
 =head3 Standalone server mode
 
     FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket
-    Alias /myapp/ /tmp/myapp/myapp.fcgi/
+    Alias /myapp/ /tmp/myapp.fcgi/
 
     # Or, run at the root
     Alias / /tmp/myapp.fcgi/
index cc994d2..935ce79 100644 (file)
@@ -7,7 +7,7 @@ BEGIN { require 5.008004; }
 
 # Remember to update this in Catalyst as well!
 
-our $VERSION='5.80020';
+our $VERSION='5.80021';
 
 $VERSION = eval $VERSION;
 
index da40bea..48003d3 100644 (file)
@@ -159,6 +159,17 @@ TODO: {
     );
 }
 
+{
+    my $index_not_private = $dispatcher->get_action_by_path(
+                             '/action/chained/argsorder/index'
+                            );
+
+    is(
+      Catalyst::uri_for( $context, $index_not_private )->as_string,
+      'http://127.0.0.1/argsorder',
+      'Return non-DispatchType::Index path for index action with args'
+    );
+}
 
 done_testing;
 
index 4431f5a..89079f9 100644 (file)
@@ -21,6 +21,8 @@ my $private_action = $dispatcher->get_action_by_path(
                        '/class_forward_test_method'
                      );
 
+warn $dispatcher->uri_for_action($private_action);
+
 ok(!defined($dispatcher->uri_for_action($private_action)),
    "Private action returns undef for URI");