Bug #86492

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

Added by Benjamin Franzke 12 months ago. Updated 12 months ago.

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

100%

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

Related to TYPO3 Core - Feature #23494: config.additionalHeaders - add stdWrap Rejected 2014-02-25

Associated revisions

Revision a5e3a154 (diff)
Added by Markus Klein 12 months ago

Revert "[FEATURE] Add stdWrap to config.additionalHeaders"

This reverts commit 2124bba49f68f5c35705c5c499abe6a0ee95a6cf.

The feature is reverted as the functionality can't be provided
in a fully working manner to work in all possible cases the FE
may be called.

Change-Id: Ia7caf3770b12737fd195da9d9f66bdc179981de8
Resolves: #86492
Reverts: #23494
Releases: master
Reviewed-on: https://review.typo3.org/58517
Reviewed-by: Mathias Brodala <>
Tested-by: Mathias Brodala <>
Reviewed-by: Benjamin Franzke <>
Tested-by: Benjamin Franzke <>
Reviewed-by: Josef Glatz <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Markus Klein 12 months ago

  • Related to Feature #23494: config.additionalHeaders - add stdWrap added

#2 Updated by Markus Klein 12 months ago

  • Status changed from New to Accepted
  • Assignee set to Markus Klein
  • Priority changed from Should have to Must have
  • Target version set to 9 LTS

The feature will be reverted as decided by Benni and me.

#3 Updated by Gerrit Code Review 12 months ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#4 Updated by Gerrit Code Review 12 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#5 Updated by Gerrit Code Review 12 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#6 Updated by Gerrit Code Review 12 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#7 Updated by Gerrit Code Review 12 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#8 Updated by Gerrit Code Review 12 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#9 Updated by Gerrit Code Review 12 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#10 Updated by Gerrit Code Review 12 months ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#11 Updated by Gerrit Code Review 12 months ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#12 Updated by Gerrit Code Review 12 months ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58517

#13 Updated by Markus Klein 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#14 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF