mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
PHP <5.3.4 compat (is_a() usage)
Our build infrastructure still runs an ancient 5.3.3, and given this is the only blocker for it, worth complicating the code a bit to retain this compatibility.
This commit is contained in:
parent
4f3c258bf4
commit
576e462823
@ -134,7 +134,7 @@ class BlogHolder extends BlogTree implements PermissionProvider {
|
||||
// Add default widgets to first found WidgetArea relationship
|
||||
if(class_exists('WidgetArea')) {
|
||||
foreach($this->has_one() as $name => $class) {
|
||||
if(is_a($class, 'WidgetArea', true)) {
|
||||
if($class == 'WidgetArea' || is_subclass_of($class, 'WidgetArea')) {
|
||||
$relationName = "{$name}ID";
|
||||
$widgetarea = new WidgetArea();
|
||||
$widgetarea->write();
|
||||
|
Loading…
Reference in New Issue
Block a user