-
Notifications
You must be signed in to change notification settings - Fork 96
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 which will be removed in CMS 6 #1868
API Deprecate API which will be removed in CMS 6 #1868
Conversation
@@ -71,6 +71,7 @@ public function getCMSEditLinkForManagedDataObject(DataObject $obj, string $reci | |||
|
|||
/** | |||
* Get a link to edit this DataObject in the CMS. | |||
* @deprecated 2.4.0 Will be replaced with SilverStripe\ORM\DataObject::getCMSEditLink() and updateCMSEditLink() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been done along-side #1809
/** @deprecated */ | ||
// Using session for this is deprecated - see https://github.com/silverstripe/silverstripe-admin/pull/19 | ||
$session = $this->getRequest()->getSession(); | ||
return $session->get($this->sessionNamespace() . ".currentPage") ?: null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove this and from setCurrentRecordID()
in the related CMS 6 PRs.
40b4345
to
54f3513
Compare
* Sets the ID for the current record which can be retrieved later through {@link currentRecordID()}. | ||
* Keep in mind that setting an ID through GET/POST or as a URL parameter will overrule this value. | ||
*/ | ||
public function setCurrentRecordID(?int $id): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note CMSMain
explicitly passes in null
, so we have to allow that.
* Uses {@link getRecord()} and {@link currentRecordID()} | ||
* to get the currently selected record. | ||
*/ | ||
public function currentRecord(): ?DataObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be null
before an edit page is opened, e.g. in CMSMain
before selecting a page.
code/LeftAndMain.php
Outdated
/** | ||
* ID of the current record for this request | ||
*/ | ||
protected ?int $recordID = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't the fact we're suddenly no longer updating $pageID lead to it potentially breaking any subclasses that rely on it?
Seems like we should continue to use $pageID for now, and then rename that to $recordID in CMS 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
54f3513
to
877dc3a
Compare
Issue
SiteTree
inCMSMain
silverstripe-cms#2947