Issue Bug Closed

#91233Cached page title is overwritten on pages with *_INT objects

Jiří Štefl 04/29/20, 12:48 updated 09/29/20, 15:07

Description

When a page has USER_INT or COA_INT objects and is delivered from cache, the page title is overwritten with standard PageTitleProviders.

Steps to reproduce:
  1. Insert plugin with cacheable action which has own PageTitleProvider. This PageTitleProvider has setter which is called from this cacheable action – e.g. $pageTitleProvider->setTitle($detailObject->getTitle().
  2. Insert some none-cacheable content.
  3. When the page is cached, the page title from plugin’s PageTitleProvider is never displayed.
Problem:
  • If the page has some none-cacheable content, then $controller->INTincScript() is called in TYPO3\CMS\Frontend\Http\RequestHandler->handle().
  • In TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController is then called the generatePageTitle() method.
  • All pageTitleProviders are loaded in TYPO3\CMS\Core\PageTitle\PageTitleProviderManager.
  • Since the custom pageTitleProvider’s setter is never called (because action is cached), the getTitle() result is empty.
  • If the none-cacheable content doesn’t set the page title, then name of the page is taken as page title.

Possible solution:
@TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->generatePageTitle()@ and TYPO3\CMS\Core\PageTitle\PageTitleProviderManager->getTitle() should have some boolean argument to know when this is called. When called from TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript(), standard pageTitleProviders (altPageTitle, seo, record) should not be loaded again, because that result was already cached.

Related to:
https://forge.typo3.org/issues/86234
https://forge.typo3.org/issues/87683

Reviews 3