From 569447d2ba4f01a4fca9684a47dc26c82ba4378b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 11 Feb 2009 00:18:00 +0000 Subject: [PATCH] BUGFIX Added E_USER_ERROR error to ComponentSet::getExtraData() if a NULL component name is passed git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71640 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/ComponentSet.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/model/ComponentSet.php b/core/model/ComponentSet.php index 1aacf6270..22bb0deef 100755 --- a/core/model/ComponentSet.php +++ b/core/model/ComponentSet.php @@ -73,13 +73,15 @@ class ComponentSet extends DataObjectSet { $parentField = $this->ownerClass . 'ID'; $childField = ($this->childClass == $this->ownerClass) ? 'ChildID' : ($this->childClass . 'ID'); $result = array(); + + if(!isset($componentName)) { + user_error('ComponentSet::getExtraData() passed a NULL component name', E_USER_ERROR); + } if(!is_numeric($childID)) { user_error('ComponentSet::getExtraData() passed a non-numeric child ID', E_USER_ERROR); } - if(!$componentName) return false; - // @todo Optimize into a single query instead of one per extra field $extraFields = $ownerObj->many_many_extraFields($componentName); if($extraFields) {