Bug #65667
closedObjectManager can't resolve underscored namespace classes to new PHP's native namespace classes since TYPO3 6.2.10
100%
Description
Since TYPO3 6.2.10 the class resolving from old namespace way with underscores seems to not work with the object manager/object container anymore. This can lead to very strange problems, because the object manager instantiates singleton classes maybe twice.
Example:
$persistenceManager1 = $this->objectManager->get('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManagerInterface'); $persistenceManager2 = $this->objectManager->get('Tx_Extbase_Persistence_ManagerInterface'); // Since TYPO3 6.2.10 results in different hash values, because they are two different instances var_dump(spl_object_hash($persistenceManager1)); var_dump(spl_object_hash($persistenceManager2)); // Thus since TYPO3 6.2.10 following comparison returns FALSE var_dump($persistenceManager1 === $persistenceManager2); // Same behavior with another example class (here with object manager) $objectManager1 = $this->objectManager->get('Tx_Extbase_Object_ObjectManagerInterface'); $objectManager2 = $this->objectManager->get('TYPO3\CMS\Extbase\Object\ObjectManagerInterface'); var_dump(spl_object_hash($objectManager1)); var_dump(spl_object_hash($objectManager2)); var_dump($objectManager1 === $objectManager2); // Returns FALSE
Best regards,
Rob
Updated by Markus Klein over 9 years ago
- Status changed from New to Accepted
- Target version set to next-patchlevel
- Is Regression changed from No to Yes
Thanks for the report!
Updated by Markus Klein over 9 years ago
Bug in \TYPO3\CMS\Extbase\Object\Container\Container::getInstanceInternal()
No class alias maps available for Core classes. Seems to be related to: #64361
Another bug in the same function, IMO:
You can't instantiate
TYPO3\\CMS\\Extbase\\Object\\Container\\Container
TYPO3\\CMS\\Core\\Cache\\CacheManager
TYPO3\\CMS\\Core\\Package\\PackageManager
with the old name, because the resolution of aliases happens after the specific checks for those classes.
Updated by Gerrit Code Review over 9 years ago
- Status changed from Accepted to Under Review
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/37825
Updated by Helmut Hummel over 9 years ago
@Rob: can you please test if the fix works for you?
Updated by Helmut Hummel over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 89f9ec40f033bb6fba4bfb7263313a16d78404de.
Updated by Gerrit Code Review over 9 years ago
- Status changed from Resolved 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 http://review.typo3.org/37915
Updated by Gerrit Code Review over 9 years ago
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/37915
Updated by Helmut Hummel over 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset cf02cd79bd0bf82afed268e3883425f327788f72.