#93759Fluid page module: not able to unset preview-header in "tt_content_drawItem" hook
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:
clipboard-202103171019-ddlyu.png
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:
clipboard-202103171017-kz2fv.png
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.
clipboard-202103171016-eq1bn.png
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?
clipboard-202103171025-yhgwu.png
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.