# This file documents the revision history for Perl extension Catalyst.
+ Bug fixed:
+ - 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:
sub register {
my ( $self, $c, $action ) = @_;
- $self->_actions->{ $action->reverse } = $action;
+ $self->_actions->{ $action->reverse } = $action if $action->name eq 'index';
return 1;
}
return undef if @$captures;
- return undef unless $action->name eq 'index';
+ return undef unless exists $self->_actions->{ $action->reverse };
return "/".$action->namespace;
}
);
}
+{
+ 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;
'/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");