X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=09493ece263a04f6dcb101f49450d3760835d9b6;hb=1ec67be9e8b738cbd2a523523af3bd7e61f98480;hp=c6cef443b397ddf128dc25354cd61553dbf599c2;hpb=ef6d6cc9adeae9b32f41b1bf388fa1be5013a5c9;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index c6cef44..09493ec 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -1,5 +1,4 @@ package Maypole; -use Class::C3; use base qw(Class::Accessor::Fast Class::Data::Inheritable); use UNIVERSAL::require; use strict; @@ -13,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: @@ -437,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; @@ -462,7 +463,7 @@ to call those actions. You may pass a query string in the usual URL style. You should not fully qualify the Maypole URLs. Note: any HTTP POST or URL parameters passed to the parent are not passed to the -component sub-request, only what is included in the url passed as an argyument +component sub-request, only what is included in the url passed as an argument to the method =cut @@ -1294,9 +1295,9 @@ sub param $self->params->{$key} = $new_val; } - return ref $val ? @$val : ($val) if wantarray; + return (ref $val eq 'ARRAY') ? @$val : ($val) if wantarray; - return ref $val ? $val->[0] : $val; + return (ref $val eq 'ARRAY') ? $val->[0] : $val; }