From: John Napiorkowski Date: Mon, 16 Nov 2015 16:11:23 +0000 (-0600) Subject: correction for unexpected check for _application being blessed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f5f241c1952fe4aa67d79f432cbb9a4bd84ad764 correction for unexpected check for _application being blessed --- diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index a30ae14..effe827 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -219,7 +219,18 @@ around action_namespace => sub { $case_s = $class->config->{case_sensitive}; } else { if (ref $self) { - $case_s = ref($self->_application)->config->{case_sensitive}; + # This seems like total wack from 2009. Not sure + # why we'd take a ref on _application since we + # expect it to be a string... Seems like it was + # part of a whole bunch of changes related to the + # failed app/ctx stuff from years ago. However + # in cases where the controller gets called in + # application context, this now fails hard. I've + # added defensive 'if its a ref' code just to be + # safe but I don't think its really ever used + my $local_app = ref($self->_application) ? + ref($self->_application): $self->_application; + $case_s = $local_app->config->{case_sensitive}; } else { confess("Can't figure out case_sensitive setting"); }