From a367a700be79b94609edbf65f1f420f816517e9d Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Sat, 9 Aug 2008 08:42:22 +0000 Subject: [PATCH] BUGFIX: Fix typedropdown not working when there are no records of that dataobject. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@60240 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/TypeDropdown.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forms/TypeDropdown.php b/forms/TypeDropdown.php index b61ef2103..630938576 100755 --- a/forms/TypeDropdown.php +++ b/forms/TypeDropdown.php @@ -18,10 +18,11 @@ class TypeDropdown extends DropdownField { $optionArray = array( '0' => _t('TypeDropdown.NONE', 'None') ); - foreach( $options as $option ) + if($options) foreach($options as $option) { $optionArray[$option->ID] = $option->Title; + } parent::__construct( $name, $title, $optionArray, $value, $form ); } } -?> \ No newline at end of file +?>