From bd977b8f654533448f37b0dca135003d997c0190 Mon Sep 17 00:00:00 2001 From: Marcus Ramberg Date: Mon, 20 Sep 2004 23:13:45 +0000 Subject: [PATCH] warn only with debug on. set encoding & charset before processing view get encoding from application in header. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@202 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole.pm | 4 ++-- lib/Maypole/View/Base.pm | 4 ++-- templates/factory/header | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Maypole.pm b/lib/Maypole.pm index d0ba118..cce6cd7 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -1,5 +1,5 @@ package Maypole; -use base qw(Class::Accessor::FAST Class::Data::Inheritable); +use base qw(Class::Accessor::Fast Class::Data::Inheritable); use attributes (); use UNIVERSAL::require; use strict; @@ -111,7 +111,7 @@ sub handler_guts { if ( my $error = $@ ) { $status = $r->call_exception($error); if ( $status != OK ) { - warn "caught view error: $error"; + warn "caught view error: $error" if $r->debug; return $r->debug ? $r->view_object->error( $r, $error ) : ERROR; } } diff --git a/lib/Maypole/View/Base.pm b/lib/Maypole/View/Base.pm index fdc6629..b577364 100644 --- a/lib/Maypole/View/Base.pm +++ b/lib/Maypole/View/Base.pm @@ -61,10 +61,10 @@ sub vars { sub process { my ( $self, $r ) = @_; - my $status = $self->template($r); - return $self->error($r) if $status != OK; $r->{content_type} ||= "text/html"; $r->{document_encoding} ||= "utf-8"; + my $status = $self->template($r); + return $self->error($r) if $status != OK; return OK; } diff --git a/templates/factory/header b/templates/factory/header index 8712c85..148cc94 100644 --- a/templates/factory/header +++ b/templates/factory/header @@ -8,7 +8,9 @@ "A poorly configured Maypole application" %] - + -- 2.39.5