mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API Update deprecations
This commit is contained in:
parent
ea92339d8d
commit
55b17c920c
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\CMS\Controllers;
|
namespace SilverStripe\CMS\Controllers;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
use SilverStripe\Admin\AdminRootController;
|
use SilverStripe\Admin\AdminRootController;
|
||||||
@ -2163,12 +2164,13 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 5.0 Use custom logic instead
|
* @deprecated 4.12.0 Use custom logic instead
|
||||||
* @param $request
|
* @param $request
|
||||||
* @return HTTPResponse|string|void
|
* @return HTTPResponse|string|void
|
||||||
*/
|
*/
|
||||||
public function publishall($request)
|
public function publishall($request)
|
||||||
{
|
{
|
||||||
|
Deprecation::notice('4.12.0', 'Use custom logic instead');
|
||||||
if (!Permission::check('ADMIN')) {
|
if (!Permission::check('ADMIN')) {
|
||||||
return Security::permissionFailure($this);
|
return Security::permissionFailure($this);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\CMS\Controllers;
|
namespace SilverStripe\CMS\Controllers;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
use SilverStripe\Admin\LeftAndMainFormRequestHandler;
|
use SilverStripe\Admin\LeftAndMainFormRequestHandler;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
@ -24,7 +25,7 @@ use SilverStripe\View\ViewableData;
|
|||||||
/**
|
/**
|
||||||
* Legacy CMS History controller. This functionality has been moved to the `silverstripe/versioned-admin` module and
|
* Legacy CMS History controller. This functionality has been moved to the `silverstripe/versioned-admin` module and
|
||||||
* this class will be removed completly in SilverStripe 5.0.0.
|
* this class will be removed completly in SilverStripe 5.0.0.
|
||||||
* @deprecated 4.3.0:5.0.0 Use silverstripe/versioned-admin instead
|
* @deprecated 4.3.0 Use silverstripe/versioned-admin instead
|
||||||
*/
|
*/
|
||||||
class CMSPageHistoryController extends CMSMain
|
class CMSPageHistoryController extends CMSMain
|
||||||
{
|
{
|
||||||
@ -59,6 +60,11 @@ class CMSPageHistoryController extends CMSMain
|
|||||||
*/
|
*/
|
||||||
protected $versionID = null;
|
protected $versionID = null;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
Deprecation::notice('4.3.0', 'Use silverstripe/versioned-admin instead', Deprecation::SCOPE_CLASS);
|
||||||
|
}
|
||||||
|
|
||||||
public function getResponseNegotiator()
|
public function getResponseNegotiator()
|
||||||
{
|
{
|
||||||
$negotiator = parent::getResponseNegotiator();
|
$negotiator = parent::getResponseNegotiator();
|
||||||
|
@ -2751,7 +2751,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 5.0 Use creatableChildPages() instead
|
* @deprecated 4.12.0 Use creatableChildPages() instead
|
||||||
*
|
*
|
||||||
* Gets a list of the page types that can be created under this specific page
|
* Gets a list of the page types that can be created under this specific page
|
||||||
*
|
*
|
||||||
@ -2759,6 +2759,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
*/
|
*/
|
||||||
public function creatableChildren()
|
public function creatableChildren()
|
||||||
{
|
{
|
||||||
|
Deprecation::notice('4.12.0', 'Use creatableChildPages() instead');
|
||||||
// Build the list of candidate children
|
// Build the list of candidate children
|
||||||
$cache = SiteTree::singleton()->getCreatableChildrenCache();
|
$cache = SiteTree::singleton()->getCreatableChildrenCache();
|
||||||
$cacheKey = $this->generateChildrenCacheKey(Security::getCurrentUser() ? Security::getCurrentUser()->ID : 0);
|
$cacheKey = $this->generateChildrenCacheKey(Security::getCurrentUser() ? Security::getCurrentUser()->ID : 0);
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
namespace SilverStripe\CMS\Model;
|
namespace SilverStripe\CMS\Model;
|
||||||
|
|
||||||
|
use SilverStripe\Dev\Deprecation;
|
||||||
use SilverStripe\Assets\File;
|
use SilverStripe\Assets\File;
|
||||||
use SilverStripe\ORM\DataExtension;
|
use SilverStripe\ORM\DataExtension;
|
||||||
use SilverStripe\View\SSViewer;
|
use SilverStripe\View\SSViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 4.2..5.0 Use FileLinkTracking instead
|
* @deprecated 4.2.0 Use FileLinkTracking instead
|
||||||
* @property File $owner
|
* @property File $owner
|
||||||
*/
|
*/
|
||||||
class SiteTreeFileExtension extends DataExtension
|
class SiteTreeFileExtension extends DataExtension
|
||||||
@ -21,6 +22,11 @@ class SiteTreeFileExtension extends DataExtension
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
Deprecation::notice('4.2.0', 'Use FileLinkTracking instead', Deprecation::SCOPE_CLASS);
|
||||||
|
}
|
||||||
|
|
||||||
public function BackLinkHTMLList()
|
public function BackLinkHTMLList()
|
||||||
{
|
{
|
||||||
$viewer = SSViewer::create(['type' => 'Includes', self::class . '_description']);
|
$viewer = SSViewer::create(['type' => 'Includes', self::class . '_description']);
|
||||||
|
@ -12,7 +12,7 @@ use SilverStripe\Admin\Forms\UsedOnTable;
|
|||||||
use SilverStripe\Versioned\RecursivePublishable;
|
use SilverStripe\Versioned\RecursivePublishable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 5.0 Use UsedOnTable instead
|
* @deprecated 4.12.0 Use UsedOnTable instead
|
||||||
*
|
*
|
||||||
* Extension applied to {@see FileFormFactory} to decorate with a "Used on:" information area.
|
* Extension applied to {@see FileFormFactory} to decorate with a "Used on:" information area.
|
||||||
* Uses tracking provided by {@see SiteTreeFileExtension} to generate this.
|
* Uses tracking provided by {@see SiteTreeFileExtension} to generate this.
|
||||||
@ -21,14 +21,25 @@ use SilverStripe\Versioned\RecursivePublishable;
|
|||||||
*/
|
*/
|
||||||
class SiteTreeFileFormFactoryExtension extends DataExtension
|
class SiteTreeFileFormFactoryExtension extends DataExtension
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @deprecated 4.12.0 Use UsedOnTable instead
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
Deprecation::notice('4.12.0', 'Use UsedOnTable instead', Deprecation::SCOPE_CLASS);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 4.12.0 Use UsedOnTable instead
|
||||||
|
*/
|
||||||
public function updateFormFields(FieldList $fields, $controller, $formName, $context)
|
public function updateFormFields(FieldList $fields, $controller, $formName, $context)
|
||||||
{
|
{
|
||||||
|
Deprecation::notice('4.12.0', 'Use UsedOnTable instead');
|
||||||
/** @var TabSet $tabset */
|
/** @var TabSet $tabset */
|
||||||
$tabset = $fields->fieldByName('Editor');
|
$tabset = $fields->fieldByName('Editor');
|
||||||
if (!$tabset) {
|
if (!$tabset) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Deprecation::notice('5.0', "Use UsedOnTable instead");
|
|
||||||
|
|
||||||
$usedOnField = UsedOnTable::create('UsedOnTableReplacement');
|
$usedOnField = UsedOnTable::create('UsedOnTableReplacement');
|
||||||
$usedOnField->setRecord($context['Record']);
|
$usedOnField->setRecord($context['Record']);
|
||||||
|
@ -15,26 +15,26 @@ use SilverStripe\ORM\DataList;
|
|||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 4.2..5.0 Will be removed without equivalent functionality to replace it
|
* @deprecated 4.2.0 Will be removed without equivalent functionality to replace it
|
||||||
*/
|
*/
|
||||||
class SiteTreeFolderExtension extends DataExtension
|
class SiteTreeFolderExtension extends DataExtension
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
Deprecation::notice('4.2.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS);
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
Deprecation::notice('5.0', 'Will be removed in 5.0');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Looks for files used in system and create where clause which contains all ID's of files.
|
* Looks for files used in system and create where clause which contains all ID's of files.
|
||||||
*
|
*
|
||||||
* @deprecated 4.2..5.0 Will be removed without equivalent functionality to replace it
|
* @deprecated 4.2.0 Will be removed without equivalent functionality to replace it
|
||||||
* @returns string where clause which will work as filter.
|
* @returns string where clause which will work as filter.
|
||||||
*/
|
*/
|
||||||
public function getUnusedFilesListFilter()
|
public function getUnusedFilesListFilter()
|
||||||
{
|
{
|
||||||
Deprecation::notice('5.0', 'Will be removed in 5.0');
|
Deprecation::notice('4.2.0', 'Will be removed without equivalent functionality to replace it');
|
||||||
|
|
||||||
// Add all records in link tracking
|
// Add all records in link tracking
|
||||||
$usedFiles = FileLink::get()->column('LinkedID');
|
$usedFiles = FileLink::get()->column('LinkedID');
|
||||||
|
@ -361,11 +361,11 @@ class VirtualPage extends Page
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 4.2..5.0 Will be removed without equivalent functionality to replace it
|
* @deprecated 4.2.0 Will be removed without equivalent functionality to replace it
|
||||||
*/
|
*/
|
||||||
public function updateImageTracking()
|
public function updateImageTracking()
|
||||||
{
|
{
|
||||||
Deprecation::notice('5.0', 'This will be removed in 5.0');
|
Deprecation::notice('4.2.0', 'Will be removed without equivalent functionality to replace it');
|
||||||
|
|
||||||
// Doesn't work on unsaved records
|
// Doesn't work on unsaved records
|
||||||
if (!$this->isInDB()) {
|
if (!$this->isInDB()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user