From 1ec67be9e8b738cbd2a523523af3bd7e61f98480 Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Fri, 18 May 2007 19:17:55 +0000 Subject: [PATCH] made setting user() and session() backward compatible git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@564 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole.pm | 8 +++++--- lib/Maypole/Model/CDBI/FromCGI.pm | 1 - lib/Maypole/View/TT.pm | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 1ac5ff4..09493ec 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'; +our $VERSION = '2.12_pre1'; our $mmagic = File::MMagic::XS->new(); # proposed privacy conventions: @@ -436,8 +436,10 @@ sub handler : method { die "status undefined after start_request_hook()" unless defined $self->status; - $self->session($self->get_session); - $self->user($self->get_user); + my $session = $self->get_session; + $self->session($self->{session} || $session); + my $user = $self->get_user; + $self->user($self->{user} || $user); my $status = $self->handler_guts; return $status unless $status == OK; diff --git a/lib/Maypole/Model/CDBI/FromCGI.pm b/lib/Maypole/Model/CDBI/FromCGI.pm index 7a725d1..217570a 100644 --- a/lib/Maypole/Model/CDBI/FromCGI.pm +++ b/lib/Maypole/Model/CDBI/FromCGI.pm @@ -1,5 +1,4 @@ package Maypole::Model::CDBI::FromCGI; -use Class::C3; use strict; use warnings; diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index 6a3bfe6..7d28440 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -3,6 +3,7 @@ use base 'Maypole::View::Base'; use Maypole::Constants; use Template; use File::Spec::Functions qw(catdir tmpdir); +use Data::Dumper; our $error_template; { local $/; $error_template = ; } @@ -16,7 +17,7 @@ sub template { unless ($self->{tt}) { my $view_options = $r->config->view_options || {}; if ($r->debug) { - $view_options->{DEBUG} = 'undef'; + $view_options->{DEBUG} = 0; } $self->{provider} = Template::Provider->new($view_options); $self->{tt} = Template->new({ -- 2.39.5