Skip to content

Commit

Permalink
ENH Update code to avoid calling deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Dec 8, 2024
1 parent e3f02ce commit e96283c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/ShareDraftContentControllerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class ShareDraftContentControllerExtension extends Extension
public function MakeShareDraftLink()
{
if ($member = Security::getCurrentUser()) {
if ($this->owner->hasMethod('CurrentPage') && $this->owner->CurrentPage()->canView($member)) {
return $this->owner->CurrentPage()->ShareTokenLink();
if ($this->owner->hasMethod('CurrentPage') && $this->owner->currentRecord()->canView($member)) {
return $this->owner->currentRecord()->ShareTokenLink();
}
if ($this->owner->hasMethod('canView') && $this->owner->canView($member)) {
return $this->owner->ShareTokenLink();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span id="$SelectID" class="preview-mode-selector preview-selector field dropdown">
<%-- 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 %>"
data-url="<% if $CurrentRecord.ShareDraftLinkAction %>{$CurrentRecord.ShareDraftLinkAction}<% else %>{$Controller.CurrentRecord.ShareDraftLinkAction}<% end_if %>"
data-helpurl="https://userhelp.silverstripe.org/en/4/optional_features/share_draft_content"
>
</span>
Expand Down

0 comments on commit e96283c

Please sign in to comment.