From ab6624ec2cab4b9f50256d4ed2aae6f49ec178b6 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Tue, 3 Dec 2024 14:15:15 +0100 Subject: [PATCH] Adjusted Resolver supports method --- src/bundle/Controller/Content/ContentTreeController.php | 1 - .../ContentTreeChildrenQueryArgumentResolver.php | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bundle/Controller/Content/ContentTreeController.php b/src/bundle/Controller/Content/ContentTreeController.php index 2ba39eb81a..50142ab94b 100644 --- a/src/bundle/Controller/Content/ContentTreeController.php +++ b/src/bundle/Controller/Content/ContentTreeController.php @@ -23,7 +23,6 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Content; use Ibexa\Contracts\Core\Repository\Values\Content\Location; use Ibexa\Contracts\Core\Repository\Values\Content\Query; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; use Ibexa\Rest\Message; diff --git a/src/bundle/ControllerArgumentResolver/ContentTreeChildrenQueryArgumentResolver.php b/src/bundle/ControllerArgumentResolver/ContentTreeChildrenQueryArgumentResolver.php index 7c1d3ee46c..463dbb0ce4 100644 --- a/src/bundle/ControllerArgumentResolver/ContentTreeChildrenQueryArgumentResolver.php +++ b/src/bundle/ControllerArgumentResolver/ContentTreeChildrenQueryArgumentResolver.php @@ -8,8 +8,8 @@ namespace Ibexa\Bundle\AdminUi\ControllerArgumentResolver; -use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\LogicalAnd; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface; use Ibexa\Contracts\Rest\Input\Parser\Query\Criterion\CriterionProcessorInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; @@ -34,7 +34,11 @@ public function __construct( public function supports(Request $request, ArgumentMetadata $argument): bool { - return Criterion::class === $argument->getType() + if ($argument->getType() === null) { + return false; + } + + return is_a($argument->getType(), CriterionInterface::class, true) && 'filter' === $argument->getName(); }