|
16 | 16 | use SilverStripe\Forms\GridField\GridFieldDetailForm; |
17 | 17 | use SilverStripe\Forms\LiteralField; |
18 | 18 | use SilverStripe\Forms\ReadonlyField; |
19 | | -use SilverStripe\ORM\ArrayList; |
20 | | -use SilverStripe\ORM\DataExtension; |
| 19 | +use SilverStripe\Model\List\ArrayList; |
| 20 | +use SilverStripe\Core\Extension; |
21 | 21 | use SilverStripe\ORM\DB; |
22 | 22 | use SilverStripe\ORM\FieldType\DBHTMLText; |
23 | 23 | use SilverStripe\Versioned\Versioned; |
24 | 24 |
|
25 | | -class BaseElementExtension extends DataExtension |
| 25 | +class BaseElementExtension extends Extension |
26 | 26 | { |
27 | 27 | /** |
28 | 28 | * @config |
@@ -54,7 +54,7 @@ public function populateDefaults() |
54 | 54 | } |
55 | 55 |
|
56 | 56 |
|
57 | | - public function requireDefaultRecords() |
| 57 | + public function onRequireDefaultRecords(): void |
58 | 58 | { |
59 | 59 | $update = BaseElement::get()->filter([ |
60 | 60 | 'VirtualLookupTitle' => [null, ''], |
@@ -179,7 +179,7 @@ public function updateCMSFields(FieldList $fields) |
179 | 179 |
|
180 | 180 | if ($ownerPage = $this->owner->getPage()) { |
181 | 181 | if ($ownerPage->hasMethod('CMSEditLink')) { |
182 | | - $link = $ownerPage->canEdit() ? $ownerPage->CMSEditLink() : $ownerPage->Link(); |
| 182 | + $link = $ownerPage->canEdit() ? $ownerPage->getCMSEditLink() : $ownerPage->Link(); |
183 | 183 | } else { |
184 | 184 | $link = $ownerPage->Link(); |
185 | 185 | } |
@@ -344,7 +344,7 @@ public function UsageSummary() |
344 | 344 | $arr = []; |
345 | 345 | foreach ($usage as $page) { |
346 | 346 | $type = ($page->ElementType) ? sprintf("<em> - %s</em>", $page->ElementType) : null; |
347 | | - $arr[] = sprintf("<a href=\"%s\" target=\"blank\">%s</a> %s", $page->CMSEditLink(), $page->Title, $type); |
| 347 | + $arr[] = sprintf("<a href=\"%s\" target=\"blank\">%s</a> %s", $page->getCMSEditLink(), $page->Title, $type); |
348 | 348 | } |
349 | 349 | $html = DBHTMLText::create('UsageSummary'); |
350 | 350 | $html->setValue(implode('<br>', $arr)); |
|
0 commit comments