Project

General

Profile

Actions

Bug #86492

closed

stdWrap on config.additionalHeaders is broken for (fully) cached pages.

Added by Benjamin Franzke about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Frontend
Target version:
Start date:
2018-10-01
Due date:
% Done:

100%

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

Description

The feature to use stdWrap for additionalHeaders was introduced in v9 development cycle: https://review.typo3.org/c/50142/
It seems this is broken since the initial commit (and is still in master).

Suppose using the following TypoScript (as suggested in the documentation):

config.additionalHeaders {
    10 {
        # The header string
        header = X-TYPO3-foo:
        header.dataWrap = |{page:uid}
    }
}

Both the original commit 2124bba49f68f5c35705c5c499abe6a0ee95a6cf and current master result in an Exception for a page that is read from cache because TypoScriptFrontendController->cObj is not initialized:

? $this->cObj->stdWrap(trim($header), $options['header.'])

Oops, an error occurred!
Call to a member function stdWrap() on string.

cObj is initialized in TSFE::newCObj, which is called by TSFE::preparePageContentGeneration, which itself is only called if the page is uncached or rendered initially (for good reasons).

I'm not sure whether we should revert this feature, instead of fixing this and implcitly allowing uncached stuff to be executed (through stdWrap) for a fully cached page. Things like these may be better handled by middlewares.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #23494: config.additionalHeaders - add stdWrapRejected2014-02-25

Actions
Actions

Also available in: Atom PDF