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 which will be removed in CMS 6 #1868

Merged

Conversation

GuySartorelli
Copy link
Member

@@ -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()
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 should have been done along-side #1809

Comment on lines -1736 to 1754
/** @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;
Copy link
Member Author

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.

* 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
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 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
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 will be null before an edit page is opened, e.g. in CMSMain before selecting a page.

/**
* ID of the current record for this request
*/
protected ?int $recordID = null;
Copy link
Member

@emteknetnz emteknetnz Dec 9, 2024

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@GuySartorelli GuySartorelli force-pushed the pulls/2/deprecations-cmsmain branch from 54f3513 to 877dc3a Compare December 9, 2024 22:08
@emteknetnz emteknetnz merged commit 02b164f into silverstripe:2 Dec 10, 2024
13 of 16 checks passed
@emteknetnz emteknetnz deleted the pulls/2/deprecations-cmsmain branch December 10, 2024 21:29
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