X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FBase.pm;h=ece5d98cb8af3167e06d8f132056c8ad1f286451;hb=f19715f56244cc6d862169c2dd656b8a2f3845b5;hp=9615950d0bf141babecac61003218050f6e9bed7;hpb=1832705643db5a1ca965d83db327dc5c7ec73ad1;p=maypole.git diff --git a/lib/Maypole/View/Base.pm b/lib/Maypole/View/Base.pm index 9615950..ece5d98 100644 --- a/lib/Maypole/View/Base.pm +++ b/lib/Maypole/View/Base.pm @@ -25,6 +25,7 @@ sub paths { push(@output, File::Spec->catdir( $path, "custom" )); push(@output, File::Spec->catdir( $path, "factory" )); } + return @output; } @@ -73,8 +74,6 @@ sub vars { sub process { my ( $self, $r ) = @_; - $r->{content_type} ||= "text/html"; - $r->{document_encoding} ||= "utf-8"; my $status = $self->template($r); return $self->error($r) if $status != OK; return OK; @@ -90,23 +89,31 @@ sub error { # a static page return -1 unless @{ $r->{objects} || [] }; + my $template_error = $r->{error}; $r->{error} = < Template not found +

Template not found

-This template was not found while processing the following request: +A template was not found while processing the following request: -@{[$r->{action}]} on table @{[ $r->{table} ]} with objects: +@{[$r->{action}]} on table +@{[ $r->{table} ]} with objects: -
+
 @{[join "\n", @{$r->{objects}}]}
-
+
+ -Looking for template @{[$r->{template}]} in paths: +The main template is @{[$r->{template}]}. +The template subsystem's error message was +
+$template_error
+
+We looked in paths: -
+
 @{[ join "\n", $self->paths($r) ]}
-
+
EOF $r->{content_type} = "text/html"; $r->{output} = $r->{error};