BUGFIX: Changing from unset record entry to an empty value shouldn't register as a 'level 2' change

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@78155 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-06-01 01:31:35 +00:00
parent 8c1cc8fcc7
commit 118cfc6ac0

View File

@ -1884,7 +1884,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
// At the very least, the type has changed
$this->changed[$fieldName] = 1;
if(!isset($this->record[$fieldName]) || $this->record[$fieldName] != $val) {
if((!isset($this->record[$fieldName]) && $val) || (isset($this->record[$fieldName]) && $this->record[$fieldName] != $val)) {
// Value has changed as well, not just the type
$this->changed[$fieldName] = 2;
}