Skip to content

API Deprecate API being removed in CMS 6#1908

Merged
emteknetnz merged 1 commit intosilverstripe:2.4from
creative-commoners:pulls/2.4/deprecations
Feb 26, 2025
Merged

API Deprecate API being removed in CMS 6#1908
emteknetnz merged 1 commit intosilverstripe:2.4from
creative-commoners:pulls/2.4/deprecations

Conversation

@GuySartorelli
Copy link
Copy Markdown
Member

@GuySartorelli GuySartorelli commented Feb 25, 2025

Note that this PR requires silverstripe/silverstripe-framework#11623 to be merged first, since that adds the new constant.

Issue

* @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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@emteknetnz emteknetnz merged commit 58c0208 into silverstripe:2.4 Feb 26, 2025
@emteknetnz emteknetnz deleted the pulls/2.4/deprecations branch February 26, 2025 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants