From a6577d9749c671e13f372869d8c4d6bd15768465 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 18 Sep 2008 03:16:03 +0000 Subject: [PATCH] Fixed bug with preivous CheckboxSetField change git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62648 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/CheckboxSetField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/CheckboxSetField.php b/forms/CheckboxSetField.php index 4ec955589..65f5f0bb8 100755 --- a/forms/CheckboxSetField.php +++ b/forms/CheckboxSetField.php @@ -110,9 +110,9 @@ class CheckboxSetField extends OptionsetField { /** * Load a value into this CheckboxSetField */ - function setValue($value, $obj) { + function setValue($value, $obj = null) { // If we're not passed a value directly, we can look for it in a relation method on the object passed as a second arg - if(!$value && $obj instanceof DataObject && $obj->hasMethod($this->name)) { + if(!$value && $obj && $obj instanceof DataObject && $obj->hasMethod($this->name)) { $funcName = $this->name; $selected = $obj->$funcName(); $value = $selected->toDropdownMap('ID','ID');