sub forward {
my $self = shift;
no warnings 'recursion';
- $self->_do_forward(forward => @_);
+ return $self->_do_forward(forward => @_);
}
sub _do_forward {
no warnings 'recursion';
$action->dispatch( $c );
+ #If there is an error, all bets off regarding state. Documentation
+ #Specifies that when you forward, if there's an error you must expect
+ #state to be 0.
+ if( @{ $c->error }) {
+ $c->state(0);
+ }
return $c->state;
}
$namespace = join( "/", grep { length } split '/', ( defined $namespace ? $namespace : "" ) );
- return $self->_action_hash->{"${namespace}/${name}"};
+ return $self->get_action_by_path("${namespace}/${name}");
}
=head2 $self->get_action_by_path( $path );
$self->_load_dispatch_types( @{ $self->preload_dispatch_types } );
@{ $self->_registered_dispatch_types }{@classes} = (1) x @classes;
- foreach my $comp ( values %{ $c->components } ) {
+ foreach my $comp ( map @{$_}{sort keys %$_}, $c->components ) {
$comp = $comp->() if ref($comp) eq 'CODE';
$comp->register_actions($c) if $comp->can('register_actions');
}