Skip to content

Commit

Permalink
[BUGFIX] Cast ModuleData "function" to int
Browse files Browse the repository at this point in the history
  • Loading branch information
nhovratov committed Mar 12, 2024
1 parent dba6495 commit e2b512d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Backend/Preview/PageLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace TYPO3\CMS\ContentBlocks\Backend\Preview;

use TYPO3\CMS\Backend\Controller\Event\ModifyPageLayoutContentEvent;
use TYPO3\CMS\Backend\Module\ModuleData;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\ContentBlocks\DataProcessing\ContentBlockData;
use TYPO3\CMS\ContentBlocks\DataProcessing\ContentBlockDataDecorator;
Expand All @@ -44,8 +45,10 @@ public function __invoke(
ModifyPageLayoutContentEvent $event
): void {
$request = $event->getRequest();
/** @var ModuleData $moduleData */
$moduleData = $request->getAttribute('moduleData');
if (($moduleData->get('function') ?? 0) !== 1) {
$function = (int)($moduleData->get('function') ?? 0);
if ($function !== 1) {
return;
}

Expand Down

0 comments on commit e2b512d

Please sign in to comment.