X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=249a3e9a604c874846bf9ad56030c2fc1888efce;hb=83f49b1a6dd37085046213013288504696d5483e;hp=7e896c3e8ff652c6dccffa1de8039a287547d266;hpb=88403615773aa8c4a86006b5d41577e586d1c0ec;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 7e896c3..249a3e9 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -12,7 +12,7 @@ use URI::QueryParam; use NEXT; use File::MMagic::XS qw(:compat); -our $VERSION = '2.12_pre1'; +our $VERSION = '2.121'; our $mmagic = File::MMagic::XS->new(); # proposed privacy conventions: @@ -187,7 +187,7 @@ __PACKAGE__->mk_accessors( user session) ); -__PACKAGE__->config( Maypole::Config->new() ); +__PACKAGE__->config( Maypole::Config->new({additional => { }, request_options => { }, view_options => { },}) ); __PACKAGE__->init_done(0); @@ -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 {