Skip to content

Commit

Permalink
API Deprecate API being removed in CMS 6
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Feb 25, 2025
1 parent 4d950df commit c5176e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Forms/GridField/GridFieldFilterHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,14 @@ public function setSearchContext(SearchContext $context): static
*
* @param GridField $gridfield
* @return string
* @deprecated 5.4.0 Will be replaced with SilverStripe\ORM\Search\SearchContextForm::getSchemaData()
*/
public function getSearchFieldSchema(GridField $gridField)
{
Deprecation::noticeWithNoReplacment(
'5.4.0',
'Will be replaced with SilverStripe\ORM\Search\SearchContextForm::getSchemaData()'
);
$schemaUrl = Controller::join_links($gridField->Link(), 'schema/SearchForm');
$inst = singleton($gridField->getModelClass());
$context = $this->getSearchContext($gridField);
Expand Down Expand Up @@ -424,9 +429,14 @@ public function getSearchForm(GridField $gridField)
*
* @param GridField $gridfield
* @return HTTPResponse
* @deprecated 5.4.0 Will be replaced with SilverStripe\Forms\FormRequestHandler::getSchema()
*/
public function getSearchFormSchema(GridField $gridField)
{
Deprecation::noticeWithNoReplacment(
'5.4.0',
'Will be replaced with SilverStripe\Forms\FormRequestHandler::getSchema()'
);
$form = $this->getSearchForm($gridField);

// If there are no filterable fields, return a 400 response
Expand Down
5 changes: 5 additions & 0 deletions src/Forms/Schema/FormSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class FormSchema
*/
const PART_AUTO = 'auto';

/**
* Form schema header identifier
*/
public const SCHEMA_HEADER = 'X-Formschema-Request';

/**
* Returns a representation of the provided {@link Form} as structured data,
* based on the request data.
Expand Down

0 comments on commit c5176e9

Please sign in to comment.