From: Tomas Doran Date: Fri, 18 Dec 2009 19:55:03 +0000 (+0000) Subject: Fix RT#52898, __MOP__ removal breaking debug screen with C::P::Session X-Git-Tag: 5.80017~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=1565e158ff4a868e199a99b779e6669ca1d9c53c Fix RT#52898, __MOP__ removal breaking debug screen with C::P::Session --- diff --git a/Changes b/Changes index 79551fe..c70d6db 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,8 @@ Bug fixes: - Remove the erroneous --detach option from Catalyst::Script::FastCGI - --daemon option to Catalyst::Script::FastCGI is fixed. + - Fix the debug dump for applications which use Catalyst::Plugin::Session + (RT#52898) 5.80016 2009-12-11 23:23:33 diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index b0a7014..c881d55 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -115,7 +115,7 @@ sub _dump_error_page_element { # This is fugly, but the metaclass is _HUGE_ and demands waaay too much # scrolling. Suggestions for more pleasant ways to do this welcome. local $val->{'__MOP__'} = "Stringified: " - . $val->{'__MOP__'} if exists $val->{'__MOP__'}; + . $val->{'__MOP__'} if ref $val eq 'HASH' && exists $val->{'__MOP__'}; my $text = encode_entities( dump( $val )); sprintf <<"EOF", $name, $text; diff --git a/t/aggregate/error_page_dump.t b/t/aggregate/error_page_dump.t new file mode 100644 index 0000000..099f8da --- /dev/null +++ b/t/aggregate/error_page_dump.t @@ -0,0 +1,15 @@ +use strict; +use warnings; +use Test::More; +use Test::Exception; + +use Catalyst::Engine; + +my $m = sub { Catalyst::Engine->_dump_error_page_element(@_) }; + +lives_ok { $m->('Scalar' => ['foo' => 'bar']) }; +lives_ok { $m->('Array' => ['foo' => []]) }; +lives_ok { $m->('Hash' => ['foo' => {}]) }; + +done_testing; +