mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API Set extension hook implementation visibility to protected
This commit is contained in:
parent
aa49eea7ce
commit
beb05d3c21
@ -11,7 +11,7 @@ use SilverStripe\Core\Extension;
|
||||
*/
|
||||
class LeftAndMainBatchActionsExtension extends Extension
|
||||
{
|
||||
public function updateBatchActionsForm(&$form)
|
||||
protected function updateBatchActionsForm(&$form)
|
||||
{
|
||||
$cmsMain = singleton(CMSMain::class);
|
||||
$form->Fields()->insertAfter('Action', $cmsMain->BatchActionParameters());
|
||||
|
@ -872,7 +872,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
* @param SiteTree $original
|
||||
* @param bool $doWrite
|
||||
*/
|
||||
public function onBeforeDuplicate($original, $doWrite)
|
||||
protected function onBeforeDuplicate($original, $doWrite)
|
||||
{
|
||||
$this->Sort = 0;
|
||||
}
|
||||
@ -1755,7 +1755,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
$this->extend('augmentSyncLinkTracking');
|
||||
}
|
||||
|
||||
public function onBeforeDelete()
|
||||
protected function onBeforeDelete()
|
||||
{
|
||||
parent::onBeforeDelete();
|
||||
|
||||
@ -1767,7 +1767,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
}
|
||||
}
|
||||
|
||||
public function onAfterDelete()
|
||||
protected function onAfterDelete()
|
||||
{
|
||||
$this->updateDependentPages();
|
||||
parent::onAfterDelete();
|
||||
@ -2621,7 +2621,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
return $actions;
|
||||
}
|
||||
|
||||
public function onAfterPublish()
|
||||
protected function onAfterPublish()
|
||||
{
|
||||
// Force live sort order to match stage sort order
|
||||
$sql = sprintf(
|
||||
@ -2638,7 +2638,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
/**
|
||||
* Update draft dependant pages
|
||||
*/
|
||||
public function onAfterRevertToLive()
|
||||
protected function onAfterRevertToLive()
|
||||
{
|
||||
// Use an alias to get the updates made by $this->publish
|
||||
/** @var SiteTree $stageSelf */
|
||||
|
@ -19,7 +19,7 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
*
|
||||
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
||||
*/
|
||||
public function onBeforePublish(&$original)
|
||||
protected function onBeforePublish(&$original)
|
||||
{
|
||||
}
|
||||
|
||||
@ -28,14 +28,14 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
*
|
||||
* @param SiteTree &$original The current Live SiteTree record prior to publish
|
||||
*/
|
||||
public function onAfterPublish(&$original)
|
||||
protected function onAfterPublish(&$original)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook called before the page's {@link Versioned::doUnpublish()} action is completed
|
||||
*/
|
||||
public function onBeforeUnpublish()
|
||||
protected function onBeforeUnpublish()
|
||||
{
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ abstract class SiteTreeExtension extends DataExtension
|
||||
/**
|
||||
* Hook called after the page's {@link SiteTree::doUnpublish()} action is completed
|
||||
*/
|
||||
public function onAfterUnpublish()
|
||||
protected function onAfterUnpublish()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class SiteTreeLinkTracking extends DataExtension
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onBeforeWrite()
|
||||
protected function onBeforeWrite()
|
||||
{
|
||||
// Trigger link tracking (unless this would also be triggered by FileLinkTracking)
|
||||
if (!$this->owner->hasExtension(FileLinkTracking::class)) {
|
||||
@ -107,7 +107,7 @@ class SiteTreeLinkTracking extends DataExtension
|
||||
/**
|
||||
* Find HTMLText fields on {@link owner} to scrape for links that need tracking
|
||||
*/
|
||||
public function augmentSyncLinkTracking()
|
||||
protected function augmentSyncLinkTracking()
|
||||
{
|
||||
// If owner is versioned, skip tracking on live
|
||||
if (Versioned::get_stage() == Versioned::LIVE && $this->owner->hasExtension(Versioned::class)) {
|
||||
@ -143,7 +143,7 @@ class SiteTreeLinkTracking extends DataExtension
|
||||
$this->owner->LinkTracking()->setByIDList($linkedPages);
|
||||
}
|
||||
|
||||
public function onAfterDelete()
|
||||
protected function onAfterDelete()
|
||||
{
|
||||
// If owner is versioned, skip tracking on live
|
||||
if (Versioned::get_stage() == Versioned::LIVE && $this->owner->hasExtension(Versioned::class)) {
|
||||
@ -215,7 +215,7 @@ class SiteTreeLinkTracking extends DataExtension
|
||||
}
|
||||
}
|
||||
|
||||
public function updateCMSFields(FieldList $fields)
|
||||
protected function updateCMSFields(FieldList $fields)
|
||||
{
|
||||
if (!$this->owner->config()->get('show_sitetree_link_tracking')) {
|
||||
$fields->removeByName('LinkTracking');
|
||||
|
@ -285,7 +285,7 @@ class VirtualPage extends Page
|
||||
return parent::getCMSFields();
|
||||
}
|
||||
|
||||
public function onBeforeWrite()
|
||||
protected function onBeforeWrite()
|
||||
{
|
||||
$this->refreshFromCopied();
|
||||
parent::onBeforeWrite();
|
||||
|
@ -6,7 +6,7 @@ use SilverStripe\Core\Extension;
|
||||
|
||||
class AdditionalAnchorPageExtension extends Extension
|
||||
{
|
||||
public function updateAnchorsOnPage(array &$anchors): void
|
||||
protected function updateAnchorsOnPage(array &$anchors): void
|
||||
{
|
||||
$anchors[] = 'dataobject-anchor';
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use SilverStripe\Dev\TestOnly;
|
||||
|
||||
class RedirectorPageTest_RedirectExtension extends Extension implements TestOnly
|
||||
{
|
||||
public function onBeforeInit()
|
||||
protected function onBeforeInit()
|
||||
{
|
||||
$this->owner->redirect('/foo');
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly
|
||||
'ExtraContent' => 'HTMLText',
|
||||
];
|
||||
|
||||
public function updateCMSFields(FieldList $fields)
|
||||
protected function updateCMSFields(FieldList $fields)
|
||||
{
|
||||
$fields->addFieldToTab("Root.Content", new HTMLEditorField("ExtraContent"));
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use SilverStripe\ORM\DataExtension;
|
||||
|
||||
class SiteTreeLinkTracking_Extension extends DataExtension implements TestOnly
|
||||
{
|
||||
public function updateAnchorsOnPage(&$anchors)
|
||||
protected function updateAnchorsOnPage(&$anchors)
|
||||
{
|
||||
array_push(
|
||||
$anchors,
|
||||
|
@ -2153,8 +2153,10 @@ class SiteTreeTest extends SapphireTest
|
||||
$obj->Content = '<a href="[sitetree_link,id='. $id .']">Link to Page</a>';
|
||||
$obj->write();
|
||||
|
||||
//Test that method doesn't throw exception
|
||||
// Test that method doesn't throw exception
|
||||
$this->expectNotToPerformAssertions();
|
||||
$page->onAfterRevertToLive();
|
||||
$method = new ReflectionMethod(SiteTree::class, 'onAfterRevertToLive');
|
||||
$method->setAccessible(true);
|
||||
$method->invoke($page);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use SilverStripe\ORM\DataExtension;
|
||||
|
||||
class SiteTreeTest_Extension extends DataExtension implements TestOnly
|
||||
{
|
||||
public function augmentValidURLSegment()
|
||||
protected function augmentValidURLSegment()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user