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 Use the new CMSEditLink extension on SiteTree #2778

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Sep 13, 2022

Use the new CMSEditLink extension from silverstripe/silverstripe-admin#1361 in SiteTree - this means a has_many relation from some page can set the page as its canonical edit owner and its CMSEditLink() method will automatically have a valid URL.

Note

Related issue

@GuySartorelli GuySartorelli changed the title ENH Use the HasCanonicalEditLink trait on SiteTree ENH Use the new CMSEditLink trait on SiteTree Sep 16, 2022
@GuySartorelli GuySartorelli force-pushed the pulls/4/canonical-edit-pages branch 3 times, most recently from b075322 to 99ec817 Compare September 19, 2022 23:40
@GuySartorelli GuySartorelli force-pushed the pulls/4/canonical-edit-pages branch from 99ec817 to 3682ef9 Compare September 26, 2022 22:06
@GuySartorelli GuySartorelli changed the title ENH Use the new CMSEditLink trait on SiteTree ENH Use the new CMSEditLink extension on SiteTree Sep 27, 2022
*
* @see CMSEditLinkExtension::getEditLinkForManagedDataObject()
*/
public function getEditLinkForManagedDataObject(SiteTree $obj): string
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public function getEditLinkForManagedDataObject(SiteTree $obj): string
public function getCMSEditLinkForManagedDataObject(SiteTree $obj): string

/**
* Get the link for editing a page.
*
* @see CMSEditLinkExtension::getEditLinkForManagedDataObject()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @see CMSEditLinkExtension::getEditLinkForManagedDataObject()
* @see CMSEditLinkExtension::getCMSEditLinkForManagedDataObject()

* The class of the LeftAndMain controller where this class is managed.
* @see CMSEditLinkExtension::getCanonicalEditOwner()
*/
private static string $canonical_edit_owner = CMSMain::class;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private static string $canonical_edit_owner = CMSMain::class;
private static string $cms_edit_owner = CMSMain::class;

@GuySartorelli GuySartorelli force-pushed the pulls/4/canonical-edit-pages branch from 3682ef9 to c7bb8c3 Compare September 29, 2022 22:05
@emteknetnz
Copy link
Member

Have merged admin PR, re-running CI

@emteknetnz emteknetnz merged commit 1f360c9 into silverstripe:4 Sep 30, 2022
@emteknetnz emteknetnz deleted the pulls/4/canonical-edit-pages branch September 30, 2022 02:10
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