Skip to content

Commit

Permalink
Merge pull request #327 from creative-commoners/pulls/5/rename-toppage
Browse files Browse the repository at this point in the history
FIX Use Updated names of top page extensions
  • Loading branch information
GuySartorelli authored Sep 10, 2024
2 parents 7c53d75 + 2a7287f commit 018d6ef
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 018d6ef

Please sign in to comment.