From: Aaron Trevena Date: Fri, 3 Aug 2007 18:04:37 +0000 (+0000) Subject: Applied change from bug 14565 X-Git-Tag: 2.12+2.121~3 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=commitdiff_plain;h=83f49b1a6dd37085046213013288504696d5483e Applied change from bug 14565 git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@580 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/Changes b/Changes index 86cf585..2b29681 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ Bug Fixes : additional, request_options and view_options attributes of Maypole::Config are initialised with hashref do_delete action now has exported attribute in ::Model::CDBI::Base Fixed links in flox to cookbook (bug 22899) + Applied change from bug 14565 2.12 22 June 2007 diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 8e24f8a..249a3e9 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -573,14 +573,17 @@ sub handler_guts { # We run additional_data for every request $self->additional_data; + # process request with model if applicable and template not set. if ($applicable) { - eval { $self->model_class->process($self) }; - if ( my $error = $@ ) { - $status = $self->call_exception($error, "model"); - if ( $status != OK ) { - $self->warn("caught model error: $error"); - return $self->debug ? - $self->view_object->error($self, $error) : ERROR; + unless ($r->{template}) { + eval { $self->model_class->process($self) }; + if ( my $error = $@ ) { + $status = $self->call_exception($error, "model"); + if ( $status != OK ) { + $self->warn("caught model error: $error"); + return $self->debug ? + $self->view_object->error($self, $error) : ERROR; + } } } } else { diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index 307d48b..b4f75c8 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -24,7 +24,6 @@ sub FETCH_CODE_ATTRIBUTES { @{ $remember{$_[1]} || [] } } sub process { my ( $class, $r ) = @_; my $method = $r->action; - return if $r->{template}; # Authentication has set this, we're done. $r->{template} = $method; my $obj = $class->fetch_objects($r);