Skip to content

Commit

Permalink
BUGFIX: Fix typedropdown not working when there are no records of that
Browse files Browse the repository at this point in the history
dataobject.


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@60240 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
ajoneil authored and Sam Minnee committed Feb 2, 2011
1 parent a3274c9 commit a367a70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions forms/TypeDropdown.php
Expand Up @@ -18,10 +18,11 @@ function __construct( $name, $title, $className, $value = null, $form = null ) {

$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 );
}
}
?>
?>

0 comments on commit a367a70

Please sign in to comment.