Project

General

Profile

Actions

Bug #65667

closed

ObjectManager can't resolve underscored namespace classes to new PHP's native namespace classes since TYPO3 6.2.10

Added by Rob Pipe over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2015-03-11
Due date:
% Done:

100%

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

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #64361: Improve class loading performanceClosed2015-01-19

Actions
Actions #1

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!

Actions #2

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.

Actions #3

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

Actions #4

Updated by Helmut Hummel over 9 years ago

@Rob: can you please test if the fix works for you?

Actions #5

Updated by Helmut Hummel over 9 years ago

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

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

Actions #7

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

Actions #8

Updated by Helmut Hummel over 9 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF