From: Shea Levy Date: Fri, 15 Mar 2013 15:54:35 +0000 (-0400) Subject: Don't serialize if a view is explicitly set. X-Git-Tag: 1.08~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=02f66fc06a2d9e248d1e551fd8e917e1eee7153f;p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git Don't serialize if a view is explicitly set. If the controller sets the view in $c->stash->{current_view} or $c->stash->{current_view_instance}, then it is explicitly requesting a certain kind of serialization and C::A::Serialize shouldn't override that. Signed-off-by: Shea Levy --- diff --git a/lib/Catalyst/Action/Serialize.pm b/lib/Catalyst/Action/Serialize.pm index be6dda5..bd9e09a 100644 --- a/lib/Catalyst/Action/Serialize.pm +++ b/lib/Catalyst/Action/Serialize.pm @@ -26,6 +26,8 @@ sub execute { return 1 if $c->response->has_body; return 1 if scalar @{ $c->error }; return 1 if $c->response->status =~ /^(?:204)$/; + return 1 if defined $c->stash->{current_view}; + return 1 if defined $c->stash->{current_view_instance}; my ( $sclass, $sarg, $content_type ) = $self->_load_content_plugins( "Catalyst::Action::Serialize",