[BUGFIX] TypeHandlingService throws Exception for StorageObjects
authorNicole Cordes <n.cordes@biz-design.biz>
Tue, 28 Aug 2012 09:27:34 +0000 (11:27 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 28 Aug 2012 18:09:46 +0000 (20:09 +0200)
On using the old ObjectStorage class the TypehandlingService throws an
exception. This patch adds old class name to type handling again.

Change-Id: Iad841c1ba19ce8b701c549e1b2dcaca86f33a748
Fixes: #40290
Related: #40095
Releases: 6.0
Reviewed-on: http://review.typo3.org/14147
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Classes/Service/TypeHandlingService.php
typo3/sysext/extbase/Tests/Unit/Service/TypeHandlingServiceTest.php

index ee85356..4e5942b 100644 (file)
@@ -53,7 +53,7 @@ class TypeHandlingService implements \TYPO3\CMS\Core\SingletonInterface {
                if (preg_match(self::PARSE_TYPE_PATTERN, $type, $matches)) {
                        $type = self::normalizeType($matches['type']);
                        $elementType = isset($matches['elementType']) ? self::normalizeType($matches['elementType']) : NULL;
-                       if ($elementType !== NULL && !in_array($type, array('array', 'ArrayObject', 'SplObjectStorage', 'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\ObjectStorage', '\TYPO3\CMS\Extbase\Persistence\Generic\ObjectStorage'))) {
+                       if ($elementType !== NULL && !in_array($type, array('array', 'ArrayObject', 'SplObjectStorage', 'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\ObjectStorage', 'Tx_Extbase_Persistence_ObjectStorage'))) {
                                throw new \InvalidArgumentException(
                                        'Type "' . $type . '" must not have an element type hint (' . $elementType . ').',
                                        1309255650
index b10f53c..3c8af26 100644 (file)
@@ -73,7 +73,8 @@ class TypeHandlingServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
                        array('array<integer>', array('type' => 'array', 'elementType' => 'integer')),
                        array('ArrayObject<string>', array('type' => 'ArrayObject', 'elementType' => 'string')),
                        array('SplObjectStorage<Tx_Extbase_Bar>', array('type' => 'SplObjectStorage', 'elementType' => 'Tx_Extbase_Bar')),
-                       array('SplObjectStorage<Tx_Extbase_Bar>', array('type' => 'SplObjectStorage', 'elementType' => 'Tx_Extbase_Bar'))
+                       array('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\ObjectStorage<Tx_Extbase_Bar>', array('type' => 'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\ObjectStorage', 'elementType' => 'Tx_Extbase_Bar')),
+                       array('Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Bar>', array('type' => 'Tx_Extbase_Persistence_ObjectStorage', 'elementType' => 'Tx_Extbase_Bar'))
                );
        }