From 93096ce2216edb35681b6360203543509d79766c Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Fri, 26 Jul 2024 11:07:05 +0200 Subject: [PATCH] [BUGFIX] Register event the old way --- Classes/FormEngine/TtAddressPreviewRenderer.php | 6 ++---- Configuration/Services.yaml | 8 +++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Classes/FormEngine/TtAddressPreviewRenderer.php b/Classes/FormEngine/TtAddressPreviewRenderer.php index 4dea7f4e..7edbaa3c 100644 --- a/Classes/FormEngine/TtAddressPreviewRenderer.php +++ b/Classes/FormEngine/TtAddressPreviewRenderer.php @@ -11,11 +11,10 @@ * LICENSE.txt file that was distributed with this source code. */ +use Doctrine\DBAL\ArrayParameterType; use TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent; -use TYPO3\CMS\Core\Attribute\AsEventListener; -use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; use TYPO3\CMS\Core\Service\FlexFormService; @@ -45,7 +44,6 @@ class TtAddressPreviewRenderer extends StandardContentPreviewRenderer ], ]; - #[AsEventListener('ext-ttaddress/fluid-preview/content')] public function __invoke(PageContentPreviewRenderingEvent $event): void { $row = $event->getRecord(); @@ -86,7 +84,7 @@ protected function getRecords(string $table, string $idList): array ->where( $queryBuilder->expr()->in( 'uid', - $queryBuilder->createNamedParameter(GeneralUtility::intExplode(',', $idList, true), Connection::PARAM_INT_ARRAY) + $queryBuilder->createNamedParameter(GeneralUtility::intExplode(',', $idList, true), ArrayParameterType::INTEGER) ) ) ->executeQuery() diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 90463d20..363f06a4 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -7,7 +7,7 @@ services: FriendsOfTYPO3\TtAddress\: resource: '../Classes/*' exclude: '../Classes/Domain/Model/*' - + FriendsOfTYPO3\TtAddress\Command\GeocodeCommand: tags: - name: 'console.command' @@ -15,3 +15,9 @@ services: description: 'Geocode tt_address records' schedulable: true hidden: false + + FriendsOfTYPO3\TtAddress\FormEngine\TtAddressPreviewRenderer: + tags: + - name: event.listener + identifier: 'ext-ttaddress/fluid-preview/content' + event: TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent