BUGFIX Setting Classname and RecordClassname properties on internal $record map when constructing a DataObject without passing $record into it. This ensures that getChangedFields() works on ClassName as well, which is required for Translatable->onBeforeWrite()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75156 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-04-27 01:36:15 +00:00
parent bc14dd3b80
commit f5d578ff8c

View File

@ -195,7 +195,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
function __construct($record = null, $isSingleton = false) {
// Set the fields data.
if(!$record) {
$record = array("ID" => 0);
$record = array(
'ID' => 0,
'ClassName' => get_class($this),
'RecordClassName' => get_class($this)
);
}
if(!is_array($record)) {