Bug #93759
closedFluid page module: not able to unset preview-header in "tt_content_drawItem" hook
0%
Description
The issue¶
This issue is about the new PreviewRenderer vs PageLayoutView.
Particularly this hook:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']
Here you have the hook called in the new StandardContentPreviewRenderer:
But when you look closely, the argument-variable $hookPreviewContent is not previously defined.
So despite it is passed by reference, you end up modifying a variable in the hook-function - without any effect.
In comparison with the old PageLayoutView, you can see the difference:
The $outHeader is determined right before the hook.
When you step up you can see, that preview-header and preview-content are processed separately and preview-header is not further passed to renderPageModulePreviewContent so it may be manipulated in the "tt_content_drawitem"-hook as always before.
How to solve?¶
I can see the intent to separate preview-header from preview-content. It makes sense somehow.
But how can we restore the original behaviour of the hook? Or should it be restored at all? -> Refactoring the PreviewRendererInterface to provide an additional argument to "renderPageModulePreviewContent" may be a quick solution - but looks rather like a workaround.
Should we dispatch a PSR-14 event somwhere here to make modification of preview-header and preview-content possible again?
Files