From: Matt S Trout Date: Thu, 22 Jun 2006 14:51:31 +0000 (+0000) Subject: probably sorted capture passing to non-leaf actions X-Git-Tag: 5.7099_04~495 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d79627719bedb6dc937f3373cebe7de967cd3fad probably sorted capture passing to non-leaf actions r10055@cain (orig r4392): matthewt | 2006-06-17 16:01:24 +0000 --- diff --git a/lib/Catalyst/ActionChain.pm b/lib/Catalyst/ActionChain.pm index 2bcc31f..ceb7c81 100644 --- a/lib/Catalyst/ActionChain.pm +++ b/lib/Catalyst/ActionChain.pm @@ -48,7 +48,13 @@ actions in order. sub dispatch { my ( $self, $c ) = @_; + my @captures = @{$c->req->captures||[]}; foreach my $action ( @{ $self->chain } ) { + my @args; + if (my $cap = $action->attributes->{Captures}) { + @args = splice(@captures, 0, $cap->[0]); + } + local $c->request->{arguments} = \@args; $action->dispatch( $c ); } }