]> git.decadent.org.uk Git - maypole.git/commitdiff
Applied change from bug 14565
authorAaron Trevena <aaron.trevena@gmail.com>
Fri, 3 Aug 2007 18:04:37 +0000 (18:04 +0000)
committerAaron Trevena <aaron.trevena@gmail.com>
Fri, 3 Aug 2007 18:04:37 +0000 (18:04 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@580 48953598-375a-da11-a14b-00016c27c3ee

Changes
lib/Maypole.pm
lib/Maypole/Model/Base.pm

diff --git a/Changes b/Changes
index 86cf585a6dc0fdf371fb5ec3c142a05dc3e10c3f..2b29681474afe76ab7a6581b71bf1ebba04e9383 100644 (file)
--- 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 
 
index 8e24f8a8f13c0aeeb7ecee8d606a270b85309901..249a3e9a604c874846bf9ad56030c2fc1888efce 100644 (file)
@@ -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 {
index 307d48b55795adea2321ed194dd4afeef10647b2..b4f75c8a0824df25d0238128aeba03e13d518eeb 100644 (file)
@@ -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);