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

ENH Update code to avoid calling deprecated code #271

Merged

Conversation

GuySartorelli
Copy link
Member

data-helpurl="https://userhelp.silverstripe.org/en/4/optional_features/share_draft_content"
data-helpurl="https://userhelp.silverstripe.org/en/optional_features/share_draft_content"
Copy link
Member Author

Choose a reason for hiding this comment

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

Not related but should be updated

@@ -2,7 +2,7 @@
<%-- Placeholder is re-rendered by the ShareDraftContent React component --%>
<span class="share-draft-content__placeholder"
data-url="<% if $CurrentPage.ShareDraftLinkAction %>{$CurrentPage.ShareDraftLinkAction}<% else %>{$Controller.CurrentPage.ShareDraftLinkAction}<% end_if %>"
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 these references must not be updated to currentRecord.

CurrentPage is not actually accessing the CurrentPage() method on the LeftAndMain (or in this case CMSMainPageEditController) instance. Instead, because of how this template gets rendered, it's falling back to the global template provider $CurrentPage which calls Controller::curr().

ShareDraftLinkAction() then gets called on the controller, not on the page record.

@GuySartorelli GuySartorelli force-pushed the pulls/3/deprecations-cmsmain branch from 58d9325 to 6a79668 Compare December 9, 2024 01:41
@emteknetnz emteknetnz merged commit 5de30ec into silverstripe:3 Dec 10, 2024
12 checks passed
@emteknetnz emteknetnz deleted the pulls/3/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