Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Update deprecations #1549

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions code/Controller/AssetAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1195,11 +1195,14 @@ public function generateThumbnails(File $file, $thumbnailLinks = false)
/**
* Action handler for adding pages to a campaign
*
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it
* @deprecated 2.4.0 Will moved to SilverStripe\CampaignAdmin\Extensions\AddToCampaignExtension
*/
public function addtocampaign(array $data, Form $form): HTTPResponse
{
Deprecation::noticeWithNoReplacment('2.4.0');
Deprecation::noticeWithNoReplacment(
'2.4.0',
'Will moved to SilverStripe\CampaignAdmin\Extensions\AddToCampaignExtension'
);
$id = $data['ID'];
$record = File::get()->byID($id);

Expand All @@ -1221,11 +1224,14 @@ public function addtocampaign(array $data, Form $form): HTTPResponse
*
* @param HTTPRequest $request
* @return Form
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it
* @deprecated 2.4.0 Will moved to SilverStripe\CampaignAdmin\Extensions\AddToCampaignExtension
*/
public function addToCampaignForm($request)
{
Deprecation::noticeWithNoReplacment('2.4.0');
Deprecation::noticeWithNoReplacment(
'2.4.0',
'Will moved to SilverStripe\CampaignAdmin\Extensions\AddToCampaignExtension'
);
// Get ID either from posted back value, or url parameter
$id = $request->param('ID') ?: $request->postVar('ID');
return $this->getAddToCampaignForm($id);
Expand All @@ -1234,11 +1240,14 @@ public function addToCampaignForm($request)
/**
* @param int $id
* @return Form|HTTPResponse
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it
* @deprecated 2.4.0 Will moved to SilverStripe\CampaignAdmin\Extensions\AddToCampaignExtension
*/
public function getAddToCampaignForm($id)
{
Deprecation::noticeWithNoReplacment('2.4.0');
Deprecation::noticeWithNoReplacment(
'2.4.0',
'Will moved to SilverStripe\CampaignAdmin\Extensions\AddToCampaignExtension'
);
// Get record-specific fields
$record = File::get()->byID($id);

Expand Down
8 changes: 6 additions & 2 deletions code/Extensions/CampaignAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
* This extension will only be applied if the `campaign-admin` module is installed.
*
* @extends Extension<FileFormFactory>
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it
* @deprecated 2.4.0 Will be replaced by SilverStripe\CampaignAdmin\Extensions\FileFormFactoryExtension
*/
class CampaignAdminExtension extends Extension
{
public function __construct()
{
Deprecation::noticeWithNoReplacment('2.4.0', scope: Deprecation::SCOPE_CLASS);
Deprecation::noticeWithNoReplacment(
'2.4.0',
'Will be replaced by SilverStripe\CampaignAdmin\Extensions\FileFormFactoryExtension',
Deprecation::SCOPE_CLASS
);
parent::__construct();
}

Expand Down