Bug #62080
closed$GLOBALS['TSFE']->page['title'] in USER doesn't work anymore for cached pages
100%
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.
Updated by Markus Klein over 9 years ago
- 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
Updated by Markus Klein over 9 years ago
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.
Updated by Gerrit Code Review over 9 years ago
- 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
Updated by Markus Klein over 9 years ago
- Status changed from Under Review to Closed
push went to wrong ticket
Updated by Markus Klein over 9 years ago
- Status changed from Closed to Under Review
code to reproduce can be found in #65832
Updated by Gerrit Code Review over 9 years ago
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
Updated by Markus Klein over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e14f3862710f7f93ae3493aabe50bb7aaf5aa892.