diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php index 64720b764d..375c082777 100644 --- a/code/Controllers/CMSMain.php +++ b/code/Controllers/CMSMain.php @@ -1833,8 +1833,6 @@ public function save(array $data, Form $form): HTTPResponse } /** - * @uses LeftAndMainExtension->augmentNewSiteTreeItem() - * * @param int|string $id * @param bool $setID * @return mixed|DataObject diff --git a/code/Model/SiteTree.php b/code/Model/SiteTree.php index 1ab304dfe5..609866770b 100755 --- a/code/Model/SiteTree.php +++ b/code/Model/SiteTree.php @@ -1137,7 +1137,6 @@ public function canAddChildren($member = null) * - "CanViewType" directive is set to "LoggedInUsers" and no user is logged in * - "CanViewType" directive is set to "OnlyTheseUsers" and user is not in the given groups * - * @uses DataExtension->canView() * @uses ViewerGroups() * * @param Member $member @@ -1284,7 +1283,6 @@ public function canDelete($member = null) * Use {@link canAddChildren()} to control behaviour of creating children under this page. * * @uses $can_create - * @uses DataExtension->canCreate() * * @param Member $member * @param array $context Optional array which may contain ['Parent' => $parentObj] @@ -1341,7 +1339,6 @@ public function canCreate($member = null, $context = []) * * @uses canView() * @uses EditorGroups() - * @uses DataExtension->canEdit() * * @param Member $member Set to false if you want to explicitly test permissions without a valid user (useful for * unit tests) diff --git a/code/Model/SiteTreeExtension.php b/code/Model/SiteTreeExtension.php deleted file mode 100644 index e2cce8ed0d..0000000000 --- a/code/Model/SiteTreeExtension.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @deprecated 5.3.0 Subclass SilverStripe\Core\Extension\Extension instead - */ -abstract class SiteTreeExtension extends DataExtension -{ - public function __construct() - { - // Wrapping with Deprecation::withNoReplacement() to avoid triggering deprecation notices - // as we are unable to update existing subclasses of this class until a new major - // unless we add in the pointless empty methods that are in this class - Deprecation::withNoReplacement(function () { - $class = Extension::class; - Deprecation::notice('5.3.0', "Subclass $class instead", Deprecation::SCOPE_CLASS); - }); - parent::__construct(); - } - - /** - * Hook called before the page's {@link Versioned::publishSingle()} action is completed - * - * @param SiteTree &$original The current Live SiteTree record prior to publish - */ - protected function onBeforePublish(&$original) - { - } - - /** - * Hook called after the page's {@link Versioned::publishSingle()} action is completed - * - * @param SiteTree &$original The current Live SiteTree record prior to publish - */ - protected function onAfterPublish(&$original) - { - } - - /** - * Hook called before the page's {@link Versioned::doUnpublish()} action is completed - */ - protected function onBeforeUnpublish() - { - } - - - /** - * Hook called after the page's {@link SiteTree::doUnpublish()} action is completed - */ - protected function onAfterUnpublish() - { - } - - /** - * Hook called to determine if a user may add children to this SiteTree object - * - * @see SiteTree::canAddChildren() - * - * @param Member $member The member to check permission against, or the currently - * logged in user - * @return boolean|null Return false to deny rights, or null to yield to default - */ - public function canAddChildren($member) - { - } - - /** - * Hook called to determine if a user may publish this SiteTree object - * - * @see SiteTree::canPublish() - * - * @param Member $member The member to check permission against, or the currently - * logged in user - * @return boolean|null Return false to deny rights, or null to yield to default - */ - public function canPublish($member) - { - } - - /** - * Hook called to modify the $base url of this page, with a given $action, - * before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()} - * on the $base and $action - * - * @param string &$link The URL of this page relative to siteroot including - * the action - * @param string $base The URL of this page relative to siteroot, not including - * the action - * @param string|boolean $action The action or subpage called on this page. - * (Legacy support) If this is true, then do not reduce the 'home' urlsegment - * to an empty link - */ - public function updateRelativeLink(&$link, $base, $action) - { - } -} diff --git a/code/Model/SiteTreeLinkTracking.php b/code/Model/SiteTreeLinkTracking.php index bfc26976a7..04385714f2 100644 --- a/code/Model/SiteTreeLinkTracking.php +++ b/code/Model/SiteTreeLinkTracking.php @@ -6,12 +6,12 @@ use SilverStripe\Assets\Shortcodes\FileLinkTracking; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\FormScaffolder; -use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\ORM\ManyManyThroughList; use SilverStripe\Versioned\Versioned; use SilverStripe\View\Parsers\HTMLValue; +use SilverStripe\Core\Extension; /** * Adds tracking of links in any HTMLText fields which reference SiteTree or File items. @@ -29,9 +29,9 @@ * @property DataObject|SiteTreeLinkTracking $owner * @method ManyManyThroughList LinkTracking() * - * @extends DataExtension + * @extends Extension */ -class SiteTreeLinkTracking extends DataExtension +class SiteTreeLinkTracking extends Extension { /** * @var SiteTreeLinkTracking_Parser diff --git a/tests/behat/features/insert-anchor-link.feature b/tests/behat/features/insert-anchor-link.feature index de9fa1f14b..98ba22564a 100644 --- a/tests/behat/features/insert-anchor-link.feature +++ b/tests/behat/features/insert-anchor-link.feature @@ -5,7 +5,7 @@ I want to insert a link into my content So that I can link to a external website or a page on my site Background: - Given I add an extension "SilverStripe\CMS\Tests\Behaviour\AdditionalAnchorPageExtension" to the "Page" class + Given I add an extension "SilverStripe\CMS\Tests\Behaviour\AdditionalAnchorPageExtension" to the "Page" class and flush only And a "page" "Home" And a "page" "About Us" has the "Content" "

My awesome content

" And a "page" "Details" has the "Content" "

My sub-par content

" diff --git a/tests/php/Controllers/LeftAndMainPageIconsExtensionTest/ModuleIconExtension.php b/tests/php/Controllers/LeftAndMainPageIconsExtensionTest/ModuleIconExtension.php index 148c4975ec..f5a01c8db0 100644 --- a/tests/php/Controllers/LeftAndMainPageIconsExtensionTest/ModuleIconExtension.php +++ b/tests/php/Controllers/LeftAndMainPageIconsExtensionTest/ModuleIconExtension.php @@ -2,11 +2,11 @@ namespace SilverStripe\CMS\Tests\Controllers\LeftAndMainpageIconsExtensionTest; -use SilverStripe\CMS\Model\SiteTreeExtension; use SilverStripe\Core\Manifest\ModuleResourceLoader; use SilverStripe\Dev\TestOnly; +use SilverStripe\Core\Extension; -class ModuleIconExtension extends SiteTreeExtension implements TestOnly +class ModuleIconExtension extends Extension implements TestOnly { public static function get_extra_config() { diff --git a/tests/php/Model/SiteTreeBacklinksTest_DOD.php b/tests/php/Model/SiteTreeBacklinksTest_DOD.php index 8f2e86fb36..2888ee2981 100644 --- a/tests/php/Model/SiteTreeBacklinksTest_DOD.php +++ b/tests/php/Model/SiteTreeBacklinksTest_DOD.php @@ -5,9 +5,9 @@ use SilverStripe\Dev\TestOnly; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\HTMLEditor\HTMLEditorField; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; -class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly +class SiteTreeBacklinksTest_DOD extends Extension implements TestOnly { private static $db = [ 'ExtraContent' => 'HTMLText', diff --git a/tests/php/Model/SiteTreeLinkTracking_Extension.php b/tests/php/Model/SiteTreeLinkTracking_Extension.php index b05913d2b4..3ce05100f2 100644 --- a/tests/php/Model/SiteTreeLinkTracking_Extension.php +++ b/tests/php/Model/SiteTreeLinkTracking_Extension.php @@ -3,9 +3,9 @@ namespace SilverStripe\CMS\Tests\Model; use SilverStripe\Dev\TestOnly; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; -class SiteTreeLinkTracking_Extension extends DataExtension implements TestOnly +class SiteTreeLinkTracking_Extension extends Extension implements TestOnly { protected function updateAnchorsOnPage(&$anchors) { diff --git a/tests/php/Model/SiteTreeTest_AdminDeniedExtension.php b/tests/php/Model/SiteTreeTest_AdminDeniedExtension.php index b2ff7d90b9..32b895575e 100644 --- a/tests/php/Model/SiteTreeTest_AdminDeniedExtension.php +++ b/tests/php/Model/SiteTreeTest_AdminDeniedExtension.php @@ -3,12 +3,12 @@ namespace SilverStripe\CMS\Tests\Model; use SilverStripe\Dev\TestOnly; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; /** * An extension that can even deny actions to admins */ -class SiteTreeTest_AdminDeniedExtension extends DataExtension implements TestOnly +class SiteTreeTest_AdminDeniedExtension extends Extension implements TestOnly { public function canCreate($member) { diff --git a/tests/php/Model/SiteTreeTest_Extension.php b/tests/php/Model/SiteTreeTest_Extension.php index 5fa0cdd84d..d01463b0cd 100644 --- a/tests/php/Model/SiteTreeTest_Extension.php +++ b/tests/php/Model/SiteTreeTest_Extension.php @@ -3,9 +3,9 @@ namespace SilverStripe\CMS\Tests\Model; use SilverStripe\Dev\TestOnly; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; -class SiteTreeTest_Extension extends DataExtension implements TestOnly +class SiteTreeTest_Extension extends Extension implements TestOnly { protected function augmentValidURLSegment() { diff --git a/tests/php/Model/SiteTreeTest_ExtensionA.php b/tests/php/Model/SiteTreeTest_ExtensionA.php index 9d3cd427aa..e07ba48dae 100644 --- a/tests/php/Model/SiteTreeTest_ExtensionA.php +++ b/tests/php/Model/SiteTreeTest_ExtensionA.php @@ -2,11 +2,11 @@ namespace SilverStripe\CMS\Tests\Model; -use SilverStripe\CMS\Model\SiteTreeExtension; use SilverStripe\Control\Controller; use SilverStripe\Dev\TestOnly; +use SilverStripe\Core\Extension; -class SiteTreeTest_ExtensionA extends SiteTreeExtension implements TestOnly +class SiteTreeTest_ExtensionA extends Extension implements TestOnly { public static $can_publish = true; diff --git a/tests/php/Model/SiteTreeTest_ExtensionB.php b/tests/php/Model/SiteTreeTest_ExtensionB.php index cf42dbbc30..086f761ff0 100644 --- a/tests/php/Model/SiteTreeTest_ExtensionB.php +++ b/tests/php/Model/SiteTreeTest_ExtensionB.php @@ -2,11 +2,11 @@ namespace SilverStripe\CMS\Tests\Model; -use SilverStripe\CMS\Model\SiteTreeExtension; use SilverStripe\Control\Controller; use SilverStripe\Dev\TestOnly; +use SilverStripe\Core\Extension; -class SiteTreeTest_ExtensionB extends SiteTreeExtension implements TestOnly +class SiteTreeTest_ExtensionB extends Extension implements TestOnly { public static $can_publish = true; diff --git a/tests/php/Model/VirtualPageTest_PageExtension.php b/tests/php/Model/VirtualPageTest_PageExtension.php index 455cd9b9e9..22ed4719c6 100644 --- a/tests/php/Model/VirtualPageTest_PageExtension.php +++ b/tests/php/Model/VirtualPageTest_PageExtension.php @@ -3,9 +3,9 @@ namespace SilverStripe\CMS\Tests\Model; use SilverStripe\Dev\TestOnly; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; -class VirtualPageTest_PageExtension extends DataExtension implements TestOnly +class VirtualPageTest_PageExtension extends Extension implements TestOnly { private static $db = [ // These fields are just on an extension to simulate shared properties between Page and VirtualPage.