mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #613 from silverstripe-rebelalliance/trac/7598
BUG $db in extensions not inited early enough (#7598)
This commit is contained in:
commit
9c57294aa9
@ -295,6 +295,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
* don't have their defaults set.
|
||||
*/
|
||||
function __construct($record = null, $isSingleton = false, $model = null) {
|
||||
|
||||
parent::__construct();
|
||||
|
||||
// Set the fields data.
|
||||
if(!$record) {
|
||||
$record = array(
|
||||
@ -345,8 +348,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
HTTP::register_modification_date($record['LastEdited']);
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
// Must be called after parent constructor
|
||||
if(!$isSingleton && (!isset($this->record['ID']) || !$this->record['ID'])) {
|
||||
$this->populateDefaults();
|
||||
|
Loading…
Reference in New Issue
Block a user