From: biopete Date: Fri, 28 Apr 2006 11:55:48 +0000 (+0000) Subject: init accessors -- bug fix 15147 X-Git-Tag: 2.11~34 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=commitdiff_plain;h=6dcd065db4b7922515289b4137428e7fcaa46b6f init accessors -- bug fix 15147 git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@486 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/Changes b/Changes index a296f66..2ca5c9a 100644 --- a/Changes +++ b/Changes @@ -81,6 +81,7 @@ Bug fixes: fixed problems with stringify_self and untaint missing ignore columns (bug 15678) fixed Maypole::Model::CDBI::Plain to JustWork(TM) with plain CDBI Classes (bug 16977) some silent death scenarios resolved + Now initializes template_args, stash, parmas, objects and others to correct data type. (bug 15147) Documentation: Fix to documentation for CGI::Maypole (bug 7263) diff --git a/lib/Maypole.pm b/lib/Maypole.pm index b1e066d..83ce94a 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -401,11 +401,16 @@ Constructs a very minimal new Maypole request object. sub new { my ($class) = @_; - my $self = bless { - template_args => {}, config => $class->config, }, $class; + + $self->stash({}); + $self->params({}); + $self->query({}); + $self->template_args({}); + $self->args([]); + $self->objects([]); return $self; } @@ -486,7 +491,14 @@ to the method sub component { my ( $r, $path ) = @_; - my $self = bless { parent => $r, config => $r->{config}, template_args => {}, }, ref $r; + my $self = bless { parent => $r, config => $r->{config}, } , ref $r; + $self->stash({}); + $self->params({}); + $self->query({}); + $self->template_args({}); + $self->args([]); + $self->objects([]); + $self->get_user; my $url = URI->new($path); warn "path : $path\n";