Skip to content

Commit

Permalink
[BUGFIX] Fix plugin preview
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed Jul 7, 2024
1 parent 525b594 commit a021519
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Classes/FormEngine/TtAddressPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
* LICENSE.txt file that was distributed with this source code.
*/

use Doctrine\DBAL\Connection;
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 @@ -43,10 +45,15 @@ class TtAddressPreviewRenderer extends StandardContentPreviewRenderer
],
];

protected function renderContentElementPreviewFromFluidTemplate(array $row): ?string
#[AsEventListener('ext-ttaddress/fluid-preview/content')]
public function __invoke(PageContentPreviewRenderingEvent $event): void
{
$row = $event->getRecord();
if ($row['list_type'] !== 'ttaddress_listview') {
return;
}
$row = $this->enrichRow($row);
return parent::renderContentElementPreviewFromFluidTemplate($row);
$event->setRecord($row);
}

protected function enrichRow(array $row): array
Expand Down

0 comments on commit a021519

Please sign in to comment.