mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
bc14dd3b80
commit
f5d578ff8c
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user