From 527f828fd3414fb3ff013a3ce6a13024594d8ddc Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 17 Dec 2024 15:48:07 +0000 Subject: [PATCH] [5.x] Fix term filter on entries listing (#11268) --- src/Query/Scopes/Filters/Fields/Terms.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Query/Scopes/Filters/Fields/Terms.php b/src/Query/Scopes/Filters/Fields/Terms.php index c3ba85c229..81f813b71b 100644 --- a/src/Query/Scopes/Filters/Fields/Terms.php +++ b/src/Query/Scopes/Filters/Fields/Terms.php @@ -3,7 +3,6 @@ namespace Statamic\Query\Scopes\Filters\Fields; use Statamic\Facades; -use Statamic\Support\Str; class Terms extends FieldtypeFilter { @@ -21,12 +20,7 @@ public function fieldItems() public function apply($query, $handle, $values) { - $term = $values['term']; - - $term = Str::ensureLeft($term, '%'); - $term = Str::ensureRight($term, '%'); - - $query->where($handle, 'like', $term); + $query->whereJsonContains($handle, $values['term']); } public function badge($values)