From c67ef43f6c28f72ea4f4c609823512097bfaa2b3 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 16 Jan 2009 04:04:13 +0000 Subject: [PATCH] MINOR initializing local variables properly in Hierarchy git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70304 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Hierarchy.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/model/Hierarchy.php b/core/model/Hierarchy.php index 5612702c4..74b063cc1 100644 --- a/core/model/Hierarchy.php +++ b/core/model/Hierarchy.php @@ -387,9 +387,11 @@ class Hierarchy extends DataObjectDecorator { * @return DataObjectSet */ public function doAllChildrenIncludingDeleted($context = null) { + $idxStageChildren = array(); + $idxLiveChildren = array(); + // Cache the allChildren data, so that future requests will return the references to the same // object. This allows the mark..() system to work appropriately. - if(!$this->_cache_allChildrenIncludingDeleted) { $baseClass = ClassInfo::baseDataClass($this->owner->class); if($baseClass) { @@ -416,11 +418,11 @@ class Hierarchy extends DataObjectDecorator { } DataObject::disable_subclass_access(); - if(isset($idxStageChildren)) { + if($idxStageChildren) { $foundInLive = Versioned::get_by_stage( $baseClass, 'Live', "\"{$baseClass}\".\"ID\" IN (" . implode(",", array_keys($idxStageChildren)) . ")", "" ); } - if(isset($idxLiveChildren)) { + if($idxLiveChildren) { $foundInStage = Versioned::get_by_stage( $baseClass, 'Stage', "\"{$baseClass}\".\"ID\" IN (" . implode(",", array_keys($idxLiveChildren)) . ")", "" ); } DataObject::enable_subclass_access();