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 Scaffold TaxonomyTerm with searchable dropdown #119

Merged

Conversation

GuySartorelli
Copy link
Member

@@ -63,33 +69,33 @@ class TaxonomyTerm extends DataObject implements PermissionProvider

public function getCMSFields()
{
$fields = parent::getCMSFields();
$this->beforeUpdateCMSFields(function (FieldList $fields) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Wrapping the implementation in beforeUpdateCMSFields() is best practice. This is partially unrelated refactoring, but it also is necessary to make sure the Children field is a gridfield before extension hooks fire, which will keep those functioning the same before and after this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

All other changes to this method (unless otherwise stated) are just explicitly using a GridField for the Children relation, instead of the auto-scaffolded searchable dropdown.

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.

Update: ignore this, I mistakenly compared this to CMS 5 instead of CMS 6

When editing a Taxonomy Term on a vanilla install of sink, there's a "Pages" tab

image

However that tab isn't there with these PRs

image

@emteknetnz emteknetnz dismissed their stale review June 26, 2024 06:00

I mistakently compared in to CMS 5 instead of CMS 6

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.

Tested locally, works well

@emteknetnz emteknetnz merged commit f2e5646 into silverstripe:4 Jun 26, 2024
12 checks passed
@emteknetnz emteknetnz deleted the pulls/4/scaffolded-fields branch June 26, 2024 22:22
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