diff --git a/src/PageTypes/BasePage.php b/src/PageTypes/BasePage.php index 76c417d..eedd352 100644 --- a/src/PageTypes/BasePage.php +++ b/src/PageTypes/BasePage.php @@ -17,6 +17,7 @@ use Symbiote\GridFieldExtensions\GridFieldOrderableRows; use TractorCow\Fluent\Model\Locale; use TractorCow\Fluent\State\FluentState; +use SilverStripe\Forms\FormField; /** * `BasePage` is a foundation page class which can be used for constructing your own page types. By default it is @@ -129,12 +130,16 @@ public function getCMSFields() ); $fields->addFieldToTab( 'Root.RelatedPages', - GridField::create( + // Use an anonymous class to set $schemaDataType so that this field + // does not throw an exception in a react context e.g. versioned-admin + new class ( 'RelatedPages', _t(__CLASS__ . '.RelatedPages', 'Related pages'), $this->RelatedPagesThrough(), $components - ) + ) extends GridField { + protected $schemaDataType = FormField::SCHEMA_DATA_TYPE_STRUCTURAL; + } ); // Taxonomies - Unless they have their own 'Tags' field (such as in Blog, etc)