diff --git a/src/Extensions/UsedOnTableExtension.php b/src/Extensions/UsedOnTableExtension.php index 77e9c294..a22b8d9c 100644 --- a/src/Extensions/UsedOnTableExtension.php +++ b/src/Extensions/UsedOnTableExtension.php @@ -3,7 +3,8 @@ namespace SilverStripe\LinkField\Extensions; use DNADesign\Elemental\Models\BaseElement; -use DNADesign\Elemental\TopPage\DataExtension as TopPageExtension; +use DNADesign\Elemental\Extensions\TopPageElementExtension; +use DNADesign\Elemental\Extensions\TopPageFluentElementExtension; use SilverStripe\Core\Extension; use SilverStripe\LinkField\Models\FileLink; use SilverStripe\ORM\DataObject; @@ -23,7 +24,11 @@ protected function updateUsageAncestorDataObjects(array &$ancestorDataObjects, D if (!class_exists(BaseElement::class) || !is_a($owner, BaseElement::class)) { return; } - $page = $owner->hasExtension(TopPageExtension::class) ? $owner->getTopPage() : $owner->getPage(); + if ($owner->hasExtension(TopPageElementExtension::class)) { + $page = $owner->getTopPage(); + } else { + $page = $owner->getPage(); + } if (!$page?->exists()) { return; }