Permalink
Browse files

Merge pull request #613 from silverstripe-rebelalliance/trac/7598

BUG $db in extensions not inited early enough (#7598)
  • Loading branch information...
2 parents ea910a5 + 890f7e3 commit 9c57294aa90d55ab6bdf2fd907547f6e76bf76eb @sminnee sminnee committed Jul 3, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 model/DataObject.php
View
@@ -295,6 +295,9 @@ private static function cache_composite_fields($class) {
* 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 @@ function __construct($record = null, $isSingleton = false, $model = null) {
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();

0 comments on commit 9c57294

Please sign in to comment.