Skip to content

Commit

Permalink
[BUGFIX] Register event the old way
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed Jul 26, 2024
1 parent f236702 commit 93096ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Classes/FormEngine/TtAddressPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -45,7 +44,6 @@ class TtAddressPreviewRenderer extends StandardContentPreviewRenderer
],
];

#[AsEventListener('ext-ttaddress/fluid-preview/content')]
public function __invoke(PageContentPreviewRenderingEvent $event): void
{
$row = $event->getRecord();
Expand Down Expand Up @@ -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()
Expand Down
8 changes: 7 additions & 1 deletion Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ services:
FriendsOfTYPO3\TtAddress\:
resource: '../Classes/*'
exclude: '../Classes/Domain/Model/*'

FriendsOfTYPO3\TtAddress\Command\GeocodeCommand:
tags:
- name: 'console.command'
command: 'ttaddress:geocode'
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

0 comments on commit 93096ce

Please sign in to comment.