From fd88d31d9d67939842b1af596518974706278e6a Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 23 Sep 2008 00:10:41 +0000 Subject: [PATCH] BUGFIX: More robust setting of defaults; necessary due to altered ViewableData::__isset() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62875 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 17eae61da..bee4f95cb 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -592,7 +592,7 @@ class DataObject extends ViewableData implements DataObjectInterface { if($defaults) foreach($defaults as $fieldName => $fieldValue) { // SRM 2007-03-06: Stricter check - if(!isset($this->$fieldName)) { + if(!isset($this->$fieldName) || $this->$fieldName === null) { $this->$fieldName = $fieldValue; } // Set many-many defaults with an array of ids