Project

General

Profile

Actions

Bug #93759

closed

Fluid page module: not able to unset preview-header in "tt_content_drawItem" hook

Added by Anonymous about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-03-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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:

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php#L97

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:

https://github.com/TYPO3/TYPO3.CMS/blob/10.4/typo3/sysext/backend/Classes/View/PageLayoutView.php#L1221

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.

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php#L79

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


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #91760: Overriding header of content elements not possible with new fluid based page moduleClosed2020-07-07

Actions
Related to TYPO3 Core - Bug #90906: Custom preview is rendered after fluid preview in Page ModuleClosedBenni Mack2020-03-31

Actions
Actions

Also available in: Atom PDF