From 19c867930c88ba6d491b6a0bf0b76a061919cbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9C=C3=A9?= Date: Wed, 29 May 2019 17:58:17 +0200 Subject: [PATCH] Process embeddedList referer on Controller --- src/Controller/EasyAdminController.php | 5 ++++- src/Resources/views/default/embedded_list.html.twig | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Controller/EasyAdminController.php b/src/Controller/EasyAdminController.php index 256b795..b8ece88 100644 --- a/src/Controller/EasyAdminController.php +++ b/src/Controller/EasyAdminController.php @@ -42,10 +42,13 @@ function ($name) use ($hiddenFields) { $removeRefererModifier = new RemoveQueryParams(['referer']); $masterRequestUri = $removeRefererModifier->process($baseMasterRequestUri); + $requestParameters = $this->request->query->all(); + $requestParameters['referer'] = (string) $masterRequestUri; + return $this->render('@EasyAdminExtension/default/embedded_list.html.twig', [ 'paginator' => $paginator, 'fields' => $fields, - 'masterRequestUri' => (string) $masterRequestUri, + '_request_parameters' => $requestParameters, ]); } diff --git a/src/Resources/views/default/embedded_list.html.twig b/src/Resources/views/default/embedded_list.html.twig index 61f9b57..6045a4b 100644 --- a/src/Resources/views/default/embedded_list.html.twig +++ b/src/Resources/views/default/embedded_list.html.twig @@ -2,10 +2,6 @@ {% trans_default_domain _entity_config.translation_domain %} {% set _trans_parameters = { '%entity_name%': _entity_config.name|trans, '%entity_label%': _entity_config.label|trans } %} -{# OVERRIDE referer #} -{% set _request_parameters = app.request.query.all %} -{% set _request_parameters = _request_parameters|merge({ referer: masterRequestUri }) %} - {% set widget_identifier = app.request.requestUri|embedded_list_identifier %} {% set _content_title %}