no more regex forwards
Sebastian Riedel [Wed, 9 Mar 2005 19:48:29 +0000 (19:48 +0000)]
Changes
lib/Catalyst.pm
lib/Catalyst/Engine.pm

diff --git a/Changes b/Changes
index 8a529af..480a2b7 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,9 @@
 This file documents the revision history for Perl extension Catalyst.
 
-4.22  Tue Mar 09 20:00:00 2005
+4.23  Wed Mar 09 20:00:00 2005
+        - no more regex actions in forward
+
+4.22  Tue Mar 08 20:00:00 2005
         - catch errors in application class
 
 4.21  Sat Mar 05 17:00:00 2005
index ab7de52..cdd9c53 100644 (file)
@@ -7,7 +7,7 @@ use Catalyst::Log;
 
 __PACKAGE__->mk_classdata($_) for qw/_config log/;
 
-our $VERSION = '4.22';
+our $VERSION = '4.23';
 our @ISA;
 
 =head1 NAME
index 83e7efb..4d25d70 100644 (file)
@@ -104,7 +104,8 @@ sub action {
                         last unless ${$i};
                         push @snippets, ${$i};
                     }
-                    return [ $name, \@snippets ];
+                    return [ $self->actions->{regex}->{$name},
+                        $name, \@snippets ];
                 }
             }
         }
@@ -346,6 +347,11 @@ sub forward {
     }
     my ( $class, $code );
     if ( my $action = $c->action($command) ) {
+        if ( $action->[2] ) {
+            $c->log->debug(qq/Couldn't forward "$command" to regex action/)
+              if $c->debug;
+            return 0;
+        }
         ( $class, $code ) = @{ $action->[0] };
     }
     else {
@@ -496,8 +502,8 @@ sub prepare_action {
 
             # It's a regex
             if ($#$result) {
-                my $match    = $result->[0];
-                my @snippets = @{ $result->[1] };
+                my $match    = $result->[1];
+                my @snippets = @{ $result->[2] };
                 $c->log->debug(qq/Requested action "$path" matched "$match"/)
                   if $c->debug;
                 $c->log->debug(