Skip to content

Commit

Permalink
FIX Use Updated names of top page extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 4, 2024
1 parent 7c53d75 commit 2a7287f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Extensions/UsedOnTableExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 2a7287f

Please sign in to comment.