From decfc9edac9eca070f532d4f62a284ead52d8c4a Mon Sep 17 00:00:00 2001 From: Tony Air Date: Tue, 20 Aug 2024 18:34:19 +0200 Subject: [PATCH] FIX: Sidebar --- src/Extensions/SiteTreeExtension.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Extensions/SiteTreeExtension.php b/src/Extensions/SiteTreeExtension.php index e22d750..9232fd5 100755 --- a/src/Extensions/SiteTreeExtension.php +++ b/src/Extensions/SiteTreeExtension.php @@ -63,6 +63,7 @@ class SiteTreeExtension extends DataExtension if (!$els) { return true; } + $sidebarEl = $els->find('ClassName', SidebarElement::class)?->first(); if ($sidebarEl) { return true; @@ -71,7 +72,8 @@ class SiteTreeExtension extends DataExtension if ($obj->SideBarContent) { return true; } - if (method_exists($obj, 'SideBarView')) { + + if (is_callable([$obj,'SideBarView'], true)) { $view = $obj->SideBarView(); if ($view && $view->Widgets()->count()) {