From 99589e626f400380f435551ccf8fce6122596c43 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 3 Nov 2008 02:33:08 +0000 Subject: [PATCH] BUGFIX Fix potential PHP notice opening a ComplexTableField popup MINOR Code formatting in ComplexTableField git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65127 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/ComplexTableField.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index ec7893fe4..b47a45718 100755 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -824,13 +824,19 @@ class ComplexTableField_ItemRequest extends RequestHandler { global $_ALL_CLASSES; $items = array(); - $parents = $_ALL_CLASSES['parents'][$this->class]; - foreach($parents as $parent) { - if(!in_array($parent,$_ALL_CLASSES['parents']["TableListField"])) $items[] = $parent . "_Popup"; + $parents = isset($_ALL_CLASSES['parents'][$this->class]) ? $_ALL_CLASSES['parents'][$this->class] : null; + + if($parents) { + foreach($parents as $parent) { + if(!in_array($parent, $_ALL_CLASSES['parents']['TableListField'])) { + $items[] = $parent . '_Popup'; + } + } } - $items[] = $this->class . "_Popup"; + + $items[] = $this->class . '_Popup'; - return implode(" ", $items); + return implode(' ', $items); }