From 8e96ebeddb37ef30d2e215f935e136a9170576cd Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Mon, 6 Nov 2006 14:04:33 +0000 Subject: [PATCH] fixed bug with multiple template roots in TT, fixed bug with frontpage path of /, removed lots of warnings git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@551 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 1 + lib/Maypole.pm | 6 +++++- lib/Maypole/View/Base.pm | 1 - lib/Maypole/View/TT.pm | 7 ++++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 3006775..e5f081c 100644 --- a/Changes +++ b/Changes @@ -20,6 +20,7 @@ For information about current developments and future releases, see: small improvements to some factory templates fix to path handling in mod_perl and CGI when location ends in / fixed template path ordering so i.e. /tablename/list is used before /list when provided with a tablename + fixed template path with array refs 2.11 Mon 31 July 2006 diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 5e85cdf..858437e 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -985,7 +985,11 @@ sub parse_path # conditionally, broke lots of tests, hence this: $self->$_(undef) for qw/action table args/; $self->preprocess_path; - $self->path || $self->path('frontpage'); + + # use frontpage template for frontpage + unless ($self->path && $self->path ne '/') { + $self->path('frontpage'); + } my @pi = grep {length} split '/', $self->path; diff --git a/lib/Maypole/View/Base.pm b/lib/Maypole/View/Base.pm index 0e9378f..753430a 100644 --- a/lib/Maypole/View/Base.pm +++ b/lib/Maypole/View/Base.pm @@ -10,7 +10,6 @@ sub new { bless {}, shift } # By default, do nothing. sub paths { my ( $self, $r ) = @_; - warn "paths called with @_"; my $root = $r->config->template_root || $r->get_template_root; if(ref($root) ne 'ARRAY') { $root = [ $root ]; diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index e4867fc..936fcc5 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -54,8 +54,6 @@ sub report_error { my ($self, $r, $error, $type) = @_; my $output; - warn "self : $self, r : $r, error : $error, type : $type\n"; - # Need to be very careful here. my $tt = Template->new; unless (ref $r->{config}) { @@ -63,11 +61,14 @@ sub report_error { $error .= '
There was a problem finding configuration for this request'; $r->{config} ||= {}; } + + $r->warn("report_error - reporting error to user : $error\n"); + if ($tt->process(\$error_template, { err_type => $type, error => $error, config => $r->{config}, request => $r, - paths => $self->paths($r), + paths => [ $self->paths($r) ], eval{$self->vars($r)} }, \$output )) { $r->{output} = $output; if ($tt->error) { $r->{output} = "Even the error template -- 2.39.2