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 Deprecate API being removed in CMS 6 #1908

Merged
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
9 changes: 6 additions & 3 deletions code/LeftAndMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ class LeftAndMain extends Controller implements PermissionProvider

/**
* Form schema header identifier
* @deprecated 2.4.0 use SilverStripe\Forms\Schema\FormSchema::SCHEMA_HEADER instead.
*/
const SCHEMA_HEADER = 'X-Formschema-Request';
const SCHEMA_HEADER = FormSchema::SCHEMA_HEADER;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really weird, can we just keep the existing string. There's pretty much zero risk of it getting changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also shouldn't we update the CMS 5 references to this that to use the new const on FormSchema instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really weird, can we just keep the existing string.

I don't think it looks weird - we're setting the value to the correct constant. It's no different than when we make a deprecated method return the value of the new method.

Also shouldn't we update the CMS 5 references to this that to use the new const on FormSchema instead?

Yes, sorry, I missed that. Done.


/**
* Enable front-end debugging (increases verbosity) in dev mode.
Expand Down Expand Up @@ -530,7 +531,7 @@ public function methodSchema(HTTPRequest $request): HTTPResponse
*/
protected function getSchemaRequested()
{
$parts = $this->getRequest()->getHeader(static::SCHEMA_HEADER);
$parts = $this->getRequest()->getHeader(FormSchema::SCHEMA_HEADER);
return !empty($parts);
}

Expand All @@ -544,7 +545,7 @@ protected function getSchemaRequested()
*/
protected function getSchemaResponse($schemaID, $form = null, ValidationResult $errors = null, $extraData = []): HTTPResponse
{
$parts = $this->getRequest()->getHeader(static::SCHEMA_HEADER);
$parts = $this->getRequest()->getHeader(FormSchema::SCHEMA_HEADER);
$data = $this
->getFormSchema()
->getMultipartSchema($parts, $schemaID, $form, $errors);
Expand Down Expand Up @@ -1271,9 +1272,11 @@ public function Breadcrumbs($unlinked = false)
*
* @throws InvalidArgumentException
* @return LeftAndMain_SearchFilter
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it.
*/
protected function getSearchFilter()
{
Deprecation::noticeWithNoReplacment('2.4.0');
if ($this->searchFilterCache) {
return $this->searchFilterCache;
}
Expand Down
1 change: 1 addition & 0 deletions code/LeftAndMain_SearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* Abstract interface for a class which may be used to filter the results displayed
* in a nested tree
* @deprecated 2.4.0 Will be removed without equivalent functionality to replace it.
*/
interface LeftAndMain_SearchFilter
{
Expand Down
Loading