mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR If the instance class property can't be found in DataObject::defineMethods(), throw an error because parent::__construct() hasn't been called which will break DataObjectDecorator
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@83580 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
99038acbf1
commit
008acc99a0
@ -302,6 +302,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
// those objects, which is a better mechanism. Perhaps extensions defined inside the
|
||||
// class def can somehow be applied at definiton time also?
|
||||
if($this->extension_instances) foreach($this->extension_instances as $i => $instance) {
|
||||
if(!$instance->class) {
|
||||
$class = get_class($instance);
|
||||
user_error("DataObject::defineMethods(): Please ensure {$class}::__construct() calls parent::__construct()", E_USER_ERROR);
|
||||
}
|
||||
DataObjectDecorator::load_extra_statics($this->class, $instance->class);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user