1818use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
1919use Symfony \Component \Form \FormFactoryInterface ;
2020use Symfony \Component \HttpFoundation \Request ;
21+ use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
2122
2223class SearchViewFilter implements EventSubscriberInterface
2324{
@@ -33,16 +34,21 @@ class SearchViewFilter implements EventSubscriberInterface
3334 /** @var \eZ\Publish\API\Repository\ContentTypeService */
3435 private $ contentTypeService ;
3536
37+ /** @var \Symfony\Component\Routing\Generator\UrlGeneratorInterface */
38+ private $ urlGenerator ;
39+
3640 public function __construct (
3741 ConfigResolverInterface $ configResolver ,
3842 FormFactoryInterface $ formFactory ,
3943 SectionService $ sectionService ,
40- ContentTypeService $ contentTypeService
44+ ContentTypeService $ contentTypeService ,
45+ UrlGeneratorInterface $ urlGenerator
4146 ) {
4247 $ this ->configResolver = $ configResolver ;
4348 $ this ->formFactory = $ formFactory ;
4449 $ this ->sectionService = $ sectionService ;
4550 $ this ->contentTypeService = $ contentTypeService ;
51+ $ this ->urlGenerator = $ urlGenerator ;
4652 }
4753
4854 public static function getSubscribedEvents ()
@@ -110,6 +116,7 @@ public function handleSearchForm(FilterViewBuilderParametersEvent $event): void
110116 [
111117 'method ' => Request::METHOD_GET ,
112118 'csrf_protection ' => false ,
119+ 'action ' => $ this ->urlGenerator ->generate ('ezplatform.search ' ),
113120 ]
114121 );
115122
0 commit comments