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 that's being removed in CMS 6 #3036

Merged

Conversation

GuySartorelli
Copy link
Member

*/
public function PageListSidebar()
{
Deprecation::noticeWithNoReplacment('5.4.0');
return $this->renderWith($this->getTemplatesWithSuffix('_PageList_Sidebar'));
Copy link
Member Author

@GuySartorelli GuySartorelli Dec 9, 2024

Choose a reason for hiding this comment

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

It's just a template that redirects to a different template. Completely pointless.

Comment on lines +236 to 241
* @deprecated 5.4.0 Will be renamed to RecordList
*/
public function PageList()
{
Deprecation::noticeWithNoReplacment('5.4.0', 'Will be renamed to RecordList');
return $this->renderWith($this->getTemplatesWithSuffix('_PageList'));
Copy link
Member Author

Choose a reason for hiding this comment

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

Note I didn't add an implementation for RecordList() because that will be using a renamed template, so people would update their calls to the method but not the template in 5 and then still have to make an update in 6 anyway.

It's extremely unlikely anyone will be calling this anyway so kinda moot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Note there's some API being removed from SiteTree in CMS 6 but doesn't need deprecating because it's moved to the Hierarchy extension in framework, which SiteTree needs in order to function at all - so those methods will still be callable and overridable in subclasses anyway.

Comment on lines +1921 to +1927
public function currentRecordID(): ?int
{
$id = parent::currentRecordID();
$this->extend('updateCurrentPageID', $id);
return $id;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Mirrors currentPageID above, but uses the same extension hook.
The CMS 6 PR will update the hook name and move it to LeftAndMain::currentRecordID() directly instead.

Comment on lines +117 to +122
/**
* @deprecated 5.4.0 Will be renamed to getRecordClasses()
*/
public function getPageClasses($page)
{
Deprecation::noticeWithNoReplacment('5.4.0', 'Will be renamed to getRecordClasses()');
Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't add the new implementations of these two methods because they're defined by the interface.

@GuySartorelli GuySartorelli force-pushed the pulls/5/deprecations-cmsmain branch from 92888ca to 2767fe7 Compare December 9, 2024 02:19
code/Controllers/CMSMain.php Outdated Show resolved Hide resolved
@GuySartorelli GuySartorelli force-pushed the pulls/5/deprecations-cmsmain branch from 2767fe7 to fd919b2 Compare December 10, 2024 21:00
@emteknetnz emteknetnz merged commit 5c1f28a into silverstripe:5 Dec 10, 2024
6 of 16 checks passed
@emteknetnz emteknetnz deleted the pulls/5/deprecations-cmsmain branch December 10, 2024 21:28
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