From 233a8fcd8587d80aca4fcb486fc5ae4332f848a4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 5 Nov 2009 00:29:21 +0000 Subject: [PATCH] BUGFIX: was being passed to foreach without a check to see if it's an array or not. (from r86202) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90834 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/CheckboxSetField.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forms/CheckboxSetField.php b/forms/CheckboxSetField.php index 61fb2c522..5cef1b055 100755 --- a/forms/CheckboxSetField.php +++ b/forms/CheckboxSetField.php @@ -79,6 +79,11 @@ class CheckboxSetField extends OptionsetField { $odd = 0; $options = ''; + + if ($source == null) { + $source = array(); + $options = "
  • No options available
  • "; + } if($source) foreach($source as $index => $item) { if(is_a($item, 'DataObject')) {