Bug #91316

MetaTagManagerRegistry instance not unique in uncached plugins

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

Status:
Resolved
Priority:
Should have
Category:
-
Target version:
Start date:
2020-05-06
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Reported by Aristeidis Karavas (Apr 28th at 11:51) via Slack:
https://typo3.slack.com/archives/C025BQLFA/p1588067478426300

Why in TYPO3 v10 this won't set the meta tags in frontend?
$metaTag = $this->metaTagManagerRegistry->getManagerForProperty($key);
$metaTag->addProperty($key, $metaTagValue);
If i debug it, it sets everything right but it won't be displayed in the frontend

The reason is that the PageRenderer stores a new Singleton via GeneralUtility::setSingletonInstance in __wakeup.

That updates MetaTagManagerRegistry instances retrieved via GeneralUtility::makeInstance, but not those injected via symfony DI,
where the object will already have been generated, as it is loaded during EXT:seo/ext_localconf.php loading and GeneralUtility::makeInstance
will call the DI container.

This issues happens when the PageRenderer was serialized and is unserialized for USER_INT plugins (e.g. uncached extbase plugins).

Same applies to AssetCollector, which is serialized and unserialized as well.


Related issues

Related to TYPO3 Core - Bug #87402: Feature-79409 renderAssetsForRequest does not work for USER_INT/uncached Closed 2019-01-11
Related to TYPO3 Core - Bug #88179: Meta tags and page title are unnecessarily cached in separate cache entries Closed 2019-04-19
Related to TYPO3 Core - Bug #91233: Cached page title is overwritten on pages with *_INT objects Resolved 2020-04-29

Associated revisions

Revision 9dd5e1a2 (diff)
Added by Benjamin Franzke 12 days ago

[BUGFIX] Reinitialize PageRenderer after deserialization

Do not swap the global singleton instance, as
that would only update new classes that are
retrived though GeneralUtlity::makeInstance).
Existing ones (cached in already initialized
classes, or initialized via the symfony DI container
would not be updated).

Releases: master, 10.4
Resolves: #91316
Related: #87402
Related: #88179
Change-Id: Ibcd4ecd3418dd047861b83685a6664e391a8f66b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64419
Tested-by: Helmut Hummel <>
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Reviewed-by: Helmut Hummel <>
Reviewed-by: Daniel Goerz <>

Revision c0602c08 (diff)
Added by Benjamin Franzke 12 days ago

[BUGFIX] Reinitialize PageRenderer after deserialization

Do not swap the global singleton instance, as
that would only update new classes that are
retrived though GeneralUtlity::makeInstance).
Existing ones (cached in already initialized
classes, or initialized via the symfony DI container
would not be updated).

Releases: master, 10.4
Resolves: #91316
Related: #87402
Related: #88179
Change-Id: Ibcd4ecd3418dd047861b83685a6664e391a8f66b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64919
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Reviewed-by: Daniel Goerz <>

History

#1 Updated by Gerrit Code Review 2 months 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/c/Packages/TYPO3.CMS/+/64419

#2 Updated by Benjamin Franzke 2 months ago

Aristeidis Karavas did now confirm that has was actually using an uncached plugin.

#3 Updated by Georg Ringer 2 months ago

  • Related to Bug #87402: Feature-79409 renderAssetsForRequest does not work for USER_INT/uncached added

#4 Updated by Georg Ringer 2 months ago

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

#5 Updated by Georg Ringer 2 months ago

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

#6 Updated by Helmut Hummel 2 months ago

  • Description updated (diff)

#7 Updated by Gerrit Code Review 2 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/c/Packages/TYPO3.CMS/+/64419

#8 Updated by DANIEL Rémy 18 days ago

This affects also TYPO3 9, because #88179 was backported.

#9 Updated by Helmut Hummel 18 days ago

DANIEL Rémy wrote:

This affects also TYPO3 9, because #88179 was backported.

Are you sure about that? As far as I can see meta tags (in contrast to title tag) are handled properly in TYPO3 9, but not in TYPO3 10

#10 Updated by Gerrit Code Review 17 days 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/c/Packages/TYPO3.CMS/+/64419

#11 Updated by Gerrit Code Review 17 days 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/c/Packages/TYPO3.CMS/+/64419

#12 Updated by Gerrit Code Review 12 days ago

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

#13 Updated by Benjamin Franzke 12 days ago

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

Also available in: Atom PDF