diff --git a/src/MappedParameter/Filter/SimpleColumnFilter.php b/src/MappedParameter/Filter/SimpleColumnFilter.php index 05ceea10..ecaac76c 100644 --- a/src/MappedParameter/Filter/SimpleColumnFilter.php +++ b/src/MappedParameter/Filter/SimpleColumnFilter.php @@ -16,6 +16,8 @@ namespace Pimcore\Bundle\StudioBackendBundle\MappedParameter\Filter; +use function is_string; + /** * @internal */ @@ -34,6 +36,10 @@ public function getType(): string public function getFilterValue(): mixed { + if (is_string($this->filterValue)) { + return trim($this->filterValue); + } + return $this->filterValue; } } diff --git a/tests/Unit/MappedParameter/Filter/SimpleColumnFilterTest.php b/tests/Unit/MappedParameter/Filter/SimpleColumnFilterTest.php new file mode 100644 index 00000000..00957b58 --- /dev/null +++ b/tests/Unit/MappedParameter/Filter/SimpleColumnFilterTest.php @@ -0,0 +1,40 @@ +assertSame('value', $filter->getFilterValue()); + } + + public function testGetFilterValue(): void + { + $filter = new SimpleColumnFilter('type', ['value']); + + $this->assertSame(['value'], $filter->getFilterValue()); + } +}