From 05b8c530848b1b7bada1e39ceb8325eb688c35d0 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 30 Dec 2004 03:36:51 +0000 Subject: [PATCH] only set $r->objects if there is an object git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@331 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 5 +++++ META.yml | 2 +- lib/Maypole/Model/Base.pm | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 1af0f4c..e81f2fa 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,11 @@ This file documents the revision history for Perl extension Maypole. For information about current developments and future releases, see: http://maypole.perl.org/?TheRoadmap +2.0X XXX + Fixes: + - Model->process() shouldn't set $r->objects() to a list with a single, + undefined element + 2.06 Wed Dec 29 01:30:00 2004 Fixes: - Minor restructuring of the manual so search.cpan.org indexes it better diff --git a/META.yml b/META.yml index 3d80d75..5b5ce58 100644 --- a/META.yml +++ b/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Maypole -version: 2.05 +version: 2.06 version_from: lib/Maypole.pm installdirs: site requires: diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index 6fc70e6..3375dfd 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -15,7 +15,8 @@ sub process { return if $r->{template}; # Authentication has set this, we're done. $r->{template} = $method; - $r->objects([ $class->fetch_objects($r) ]); + my $obj = $class->fetch_objects($r); + $r->objects([$obj]) if $obj; $class->$method( $r, $obj, @{ $r->{args} } ); } -- 2.39.2