mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
This class attempts to run the extraStatics method without first checking it exists. There's no reason why a data object decorator would necessarily add extra statics.
This commit is contained in:
parent
dfb0504d0d
commit
cbd42ed053
3
model/DataExtension.php
Executable file → Normal file
3
model/DataExtension.php
Executable file → Normal file
@ -62,6 +62,9 @@ abstract class DataExtension extends Extension {
|
|||||||
// If the extension has been manually applied to a subclass, we should ignore that.
|
// If the extension has been manually applied to a subclass, we should ignore that.
|
||||||
if(Object::has_extension(get_parent_class($class), $extensionClass)) return;
|
if(Object::has_extension(get_parent_class($class), $extensionClass)) return;
|
||||||
|
|
||||||
|
// If there aren't any extraStatics we shouldn't try to load them.
|
||||||
|
if ( ! method_exists($extensionClass, $extraStaticsMethod) ) return;
|
||||||
|
|
||||||
$statics = call_user_func(array($extensionClass, $extraStaticsMethod), $class, $extension);
|
$statics = call_user_func(array($extensionClass, $extraStaticsMethod), $class, $extension);
|
||||||
|
|
||||||
if($statics) {
|
if($statics) {
|
||||||
|
Loading…
Reference in New Issue
Block a user