Bug #62080
closed
$GLOBALS['TSFE']->page['title'] in USER doesn't work anymore for cached pages
Added by Julian Klassen about 10 years ago.
Updated about 6 years ago.
Description
Since commit 1263413f305a459080b895f762740bbfaeaca686 which fixed issue #54467, you can't correctly set the page title in a USER plugin anymore. The new call to regeneratePageTitle() unconditionally sets the page title based on the values of $TSFE->altPageTitle
/ page['title']
at the time of the request.
If the page title gets set from a USER plugin, those values are only correctly set for requests that aren't answered from the cache. All later requests that are answered from the cache don't execute the USER plugin, and therefore the new call to regenerateTitle() sets the page title to its "regular" value, overriding the value initially set by the USER plugin.
- Category set to Frontend
- Status changed from New to Accepted
- Assignee set to Markus Klein
- Priority changed from Should have to Must have
- Target version set to next-patchlevel
- Complexity set to hard
- Is Regression changed from No to Yes
This is really a tough thing.
Considering a partially cached page, we have the situation that the cached page parts might be having a USER plugin which sets a custom page title. So the content coming from the cache (in particular the restored PageRenderer) already contains the valid title. The subsequent call to PageGenerator::generatePageTitle() will overwrite those valid values with the "fresh" data from TSFE. But the data of TSFE are not preset with the data from the restored PageRenderer, hence the title is overridden.
If we remove the call to PageGenerator::generatePageTitle() would fix the issue, but then USER_INT plugins will not be able to set the page title, so we would be back to issue #54467.
The only solution can therefore be to either preset the TSFE data accordingly, or to double-buffer write actions to TSFE. Second is not possible, since the members are public and no setters are in place.
- Status changed from Accepted to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37938
- Status changed from Under Review to Closed
push went to wrong ticket
- Status changed from Closed to Under Review
code to reproduce can be found in #65832
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38264
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF