From 63f11088545afb2efa2014362b49412c4466071b Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 10 Apr 2024 21:33:32 +0200 Subject: [PATCH] Fix getLabelTranslationParameters (#8175) --- src/Filter/Filter.php | 2 +- tests/Filter/FilterTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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',