Bug #87683

TitleTagProvider always get the cached entry

Added by Guido Schmechel over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Category:
SEO
Target version:
-
Start date:
2019-02-10
Due date:
% Done:

0%

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

Description

Given scenario:
I have a searchresult page (e.g. UID 42). The post requests variables are used for generating title tag and meta description. There is a custom TitleTagProvider which deliver a custom title, e.g. "Hello world 123" or if another search is correct "Hello world 456"

Btw: The searchresultAction is uncached.

Output:
Case 1: "Hello world 123"
Case 2: "Hello world 123"

Expected Result:
Case 1: "Hello world 123"
Case 2: "Hello world 456"

Problem:
TYPO3 saves title Tag, also custom Provider, in typo3/sysext/core/Classes/PageTitle/PageTitleProviderManager.php $cacheIdentifier. It never looks for the content of the titleTag.

$cacheIdentifier =  $this->getTypoScriptFrontendController()->newHash . '-titleTag-' . $provider;

Possible solution:
Integrate (hashed?) titleTag content in the cacheIdentifier.

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/PageTitle/PageTitleProviderManager.php#L69

Same problem exists for the MetaTags.


Related issues

Related to TYPO3 Core - Bug #88179: Meta tags and page title are unnecessarily cached in separate cache entriesClosed2019-04-19

Actions
Related to TYPO3 Core - Bug #91233: Cached page title is overwritten on pages with *_INT objectsClosed2020-04-29

Actions
#1

Updated by Richard Haeser over 2 years ago

  • Category set to SEO
  • Assignee set to Richard Haeser
#2

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New 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/59684

#3

Updated by Gerrit Code Review over 2 years 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/59684

#4

Updated by Richard Haeser about 2 years ago

  • Status changed from Under Review to Needs Feedback

Is the title "Hello world 456" set by an uncached element?

#5

Updated by Guido Schmechel about 2 years ago

I have an uncached searchAction. It fetches two values from the database and then does that here:

            $title = $postal->getPostal() . ' ' . $postal->getCity();
            $titleProvider = GeneralUtility::makeInstance(PoiTitleProvider::class);
            $titleProvider->setTitle($title);

PoiTitleProvider is just a simple class with a title setter.

Registration

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(trim('
    config.pageTitleProviders {
        own {
            provider = Ayacoo\AyacooPoi\PageTitle\PoiTitleProvider
            before = record
            after = altPageTitle
        }
    }
'));

#6

Updated by Richard Haeser about 2 years ago

  • Status changed from Needs Feedback to New
#7

Updated by Guido Schmechel about 2 years ago

  • Related to Bug #88179: Meta tags and page title are unnecessarily cached in separate cache entries added
#8

Updated by Richard Haeser almost 2 years ago

  • Status changed from New to Resolved

This is fixed with the release of v9.5.8

#9

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
#10

Updated by Helmut Hummel 11 months ago

  • Related to Bug #91233: Cached page title is overwritten on pages with *_INT objects added

Also available in: Atom PDF