From eb0d2066731f16d7020367e3e35b6ab0ecfb54ee Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Sun, 13 Jun 2021 19:31:13 +0200 Subject: [PATCH] [TASK] Add object option for setting up ajax env --- Classes/Controller/ActionController.php | 10 +++++++--- Classes/Utility/MailUtility.php | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Classes/Controller/ActionController.php b/Classes/Controller/ActionController.php index 5131f16..e5599f1 100644 --- a/Classes/Controller/ActionController.php +++ b/Classes/Controller/ActionController.php @@ -584,6 +584,7 @@ class ActionController extends BaseController ->getUriBuilder() ->reset() ->setCreateAbsoluteUri(true) + ->setAddQueryString(true) ->setTargetPageType($this->ajaxPageType) ->setArguments(['cid' => $this->contentObjectUid]) ->uriFor($this->request->getControllerActionName()); @@ -697,9 +698,12 @@ class ActionController extends BaseController * @param array $result * @return void */ - protected function returnFunction($result = [], $errorStatus = null) - { - $this->setAjaxEnv(); + protected function returnFunction( + $result = [], + $errorStatus = null, + $object = 'data' + ) { + $this->setAjaxEnv($object); if ($result == null) { $result = []; } diff --git a/Classes/Utility/MailUtility.php b/Classes/Utility/MailUtility.php index 8643b09..90154eb 100644 --- a/Classes/Utility/MailUtility.php +++ b/Classes/Utility/MailUtility.php @@ -138,7 +138,6 @@ class MailUtility $htmlRow['data'] = preg_replace_callback( '/\[.*\]/mU', function($matches) { - foreach ($matches as $match) { return preg_replace_callback( '/\[(\S*)\s(.*)\]/mU',