diff --git a/src/Extension/Traits/FluentObjectTrait.php b/src/Extension/Traits/FluentObjectTrait.php index d1103921..3a626e1d 100644 --- a/src/Extension/Traits/FluentObjectTrait.php +++ b/src/Extension/Traits/FluentObjectTrait.php @@ -11,6 +11,7 @@ use SilverStripe\Forms\GridField\GridFieldConfig; use SilverStripe\Forms\GridField\GridFieldConfig_Base; use SilverStripe\Forms\GridField\GridFieldDataColumns; +use SilverStripe\Forms\GridField\GridFieldFilterHeader; use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataQuery; @@ -106,6 +107,8 @@ protected function updateFluentCMSFields(FieldList $fields) // Generate gridfield for handling localisations $config = GridFieldConfig_Base::create(); + // Remove filters as the displayed data is in ArrayList format + $config->removeComponentsByType(GridFieldFilterHeader::class); $columns = $config->getComponentByType(GridFieldDataColumns::class); $summaryColumns = [ diff --git a/tests/php/Extension/FluentFilteredExtensionTest.php b/tests/php/Extension/FluentFilteredExtensionTest.php index 17b5eacf..0d0a9d49 100644 --- a/tests/php/Extension/FluentFilteredExtensionTest.php +++ b/tests/php/Extension/FluentFilteredExtensionTest.php @@ -7,6 +7,7 @@ use SilverStripe\Core\Config\Config; use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\GridField\GridField; +use SilverStripe\Forms\GridField\GridFieldFilterHeader; use SilverStripe\ORM\DataObject; use SilverStripe\Versioned\Versioned; use TractorCow\Fluent\Extension\FluentFilteredExtension; @@ -151,6 +152,7 @@ public function testUpdateCMSFields() LocaleToggleColumn::class, $config->getComponentByType(LocaleToggleColumn::class) ); + $this->assertNull($config->getComponentByType(GridFieldFilterHeader::class)); }); }