From: Tomas Doran Date: Sat, 21 Mar 2009 15:56:08 +0000 (+0000) Subject: Hack _invoke_as_component in a horrible way, so that it gives us back a path Action... X-Git-Tag: 5.80001~57^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=84c28acbcf93fc27a01b9bba70fd2ffdfefe91e1 Hack _invoke_as_component in a horrible way, so that it gives us back a path Action if it can, which makes >visit work correctly with qw/MyApp::Controller::Chained method_name/. I feel dirty, but it makes the test pass.. --- diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 865dd2f..840342b 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -320,6 +320,17 @@ sub _invoke_as_component { my $class = $self->_find_component_class( $c, $component ) || return 0; + ### XXX FIXME - Horrible hack to get proper action objects for + ### controller paths.. + if ($class =~ /::C(ontroller)?::/) { + my $possible_path = $class . '/' . $method; + $possible_path =~ s/.+::C(ontroller)?:://; + $possible_path =~ s|::|/|g; + $possible_path =~ tr/A-Z/a-z/; + my $possible_action = $self->_invoke_as_path( $c, '/' . $possible_path ); + return $possible_action if $possible_action; + } + if ( my $code = $class->can($method) ) { return $self->_method_action_class->new( {