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

NEW Provide a standardised CMSEditLink method #11338

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Aug 15, 2024

Provides a standard implementation and method signature for the CMSEditLink() method which is used in various places. See related PRs.
This change allows us to convert the public CMSEditLink() method on CMSEditLinkExtension to instead be an appropriate protected updateCMSEditLink() extension hook. See silverstripe/silverstripe-admin#1809

If we were doing this from scratch I'd call it getEditLink() - if you want that change, since this is a major release I can do that, but bear in mind that change introduces upgrade pain with probably 0 value added, so don't ask for it unless you can indicate some value it adds to offset the upgrade pain it'd introduce.

Issue

@@ -4143,6 +4153,7 @@ public static function enable_subclass_access()
*/
private static $casting = [
"Title" => 'Text',
'CMSEditLink' => 'Text',
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Could we change it to getEditLink(), rename the extension hook updateEditLink and then retain CMSEditLink() as a method that simply calls getEditLink(), deprecate but don't remove it until CMS 7?

@GuySartorelli
Copy link
Member Author

Discussed in person - decided not to rename it given we have other CMS related methods in DataObject (e.g. getCMSFields()) and both being consistent with that naming scheme and being explicit that the edit link is for editing within the CMS is probably preferable.

src/ORM/DataObject.php Outdated Show resolved Hide resolved
@GuySartorelli GuySartorelli force-pushed the pulls/6/standardise-cmseditlink branch from 147fa90 to 710f1a8 Compare August 22, 2024 03:51
@GuySartorelli GuySartorelli force-pushed the pulls/6/standardise-cmseditlink branch from 710f1a8 to 9d2050a Compare August 22, 2024 23:38
@emteknetnz emteknetnz merged commit e3508d4 into silverstripe:6 Aug 25, 2024
12 checks passed
@emteknetnz emteknetnz deleted the pulls/6/standardise-cmseditlink branch August 25, 2024 22:56
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