Bug #73671
closedSingleton makeInstance and XClass problem (setSingletonInstance)
100%
Description
There is a big problem with XClasses of a Class that implements the singleton interface in combination of manually setting a new singleton instance.
When creating an instances of a class, the xclass is created, but the singleton checks is always made for the xclass, never the original class.
If you set an Singleton class manually, this object will never be returned.
My specific problem lies with \TYPO3\CMS\Core\Page\PageRenderer.
When i create an xclass for this class, the new class is used. For caching purposes (?) the class gets serialized and in the TypoScriptFrontendController->INTincScript the class gehts unserialized.
Afterwards the class gets sets as the new singletoninstance: GeneralUtility::setSingletonInstance(PageRenderer::class, $pageRenderer);
But the GeneralUtility:makeInstance(PageRenderer::class) still returns the old object, not the new one.
In \TYPO3\CMS\Rsaauth\RsaEncryptionEncoder the addJsFile method is called for the old object, and therefore the Javascript is not outputted into the frontend.
This problem took a lot of analysing, and i think the error lies within the GeneralUtility::setSingletonInstance call, because there is assignment for the "$finalClassNameCache"
Updated by Helmut Hummel over 8 years ago
- Status changed from New to Accepted
good point, thanks. final class name and class name handling should be fixed
Updated by Gerrit Code Review over 4 years ago
- Status changed from Accepted 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/+/63618
Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/63618
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63586
Updated by Benni Mack over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset dafc3c6ee50a970c8098ab8dc88f35d4715288fa.