diff --git a/src/Filter/Filter.php b/src/Filter/Filter.php index 4231947f87..05cce37744 100644 --- a/src/Filter/Filter.php +++ b/src/Filter/Filter.php @@ -258,7 +258,7 @@ final public function showFilter(): ?bool */ final public function getLabelTranslationParameters(): array { - return $this->getOption('label_translation_parameters'); + return $this->getOption('label_translation_parameters', []); } final public function withAdvancedFilter(): bool diff --git a/tests/Filter/FilterTest.php b/tests/Filter/FilterTest.php index 08c272369a..f00cc83c48 100644 --- a/tests/Filter/FilterTest.php +++ b/tests/Filter/FilterTest.php @@ -27,6 +27,8 @@ public function testFilter(): void static::assertSame(TextType::class, $filter->getFieldType()); static::assertSame([], $filter->getFieldOptions()); static::assertNull($filter->getLabel()); + static::assertNull($filter->getTranslationDomain()); + static::assertSame([], $filter->getLabelTranslationParameters()); $options = [ 'label' => 'foo',