From d6fc7fe8040a9701a380bfa9c25497a9dc63fbe9 Mon Sep 17 00:00:00 2001 From: tdenev Date: Sun, 5 Apr 2020 18:53:21 +0100 Subject: [PATCH] Fix issue with the GridField documenation - many_many_extraFields code example --- .../02_Developer_Guides/03_Forms/Field_types/04_GridField.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/02_Developer_Guides/03_Forms/Field_types/04_GridField.md b/docs/en/02_Developer_Guides/03_Forms/Field_types/04_GridField.md index 15e4ab502..9436d89e6 100644 --- a/docs/en/02_Developer_Guides/03_Forms/Field_types/04_GridField.md +++ b/docs/en/02_Developer_Guides/03_Forms/Field_types/04_GridField.md @@ -329,6 +329,7 @@ The namespace notation is `ManyMany[]`, so for example `Ma use SilverStripe\Forms\TextField; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor; +use SilverStripe\Forms\GridField\GridFieldDetailForm; use SilverStripe\ORM\DataObject; class Team extends DataObject @@ -338,7 +339,7 @@ class Team extends DataObject 'Name' => 'Text' ]; - public static $many_many = [ + public static $belongs_many_many = [ 'Players' => 'Player' ]; } @@ -372,7 +373,7 @@ class Player extends DataObject ); $config = GridFieldConfig_RelationEditor::create(); - $config->getComponentByType('GridFieldDetailForm')->setFields($teamFields); + $config->getComponentByType(GridFieldDetailForm::class)->setFields($teamFields); $gridField = new GridField('Teams', 'Teams', $this->Teams(), $config); $fields->findOrMakeTab('Root.Teams')->replaceField('Teams', $gridField);