[BUGFIX] Persistent classes with more than five name parts in extbase 49/38749/3
authorArtus Kolanowski <artus@ionoi.net>
Thu, 16 Apr 2015 19:10:09 +0000 (21:10 +0200)
committerFrank Nägler <typo3@naegler.net>
Fri, 1 May 2015 12:59:50 +0000 (14:59 +0200)
Resolve the table name of a corresponding class correctly when the name
has more than five parts.

This avoids unexpected SQL syntax errors when you have a full qualified
class names like "\Vendor\Extension\Domain\Model\Foo\Bar\Baz".

Resolves: #66425
Releases: master, 6.2
Change-Id: If31fe53bc34a3b2f2080732b2a0237d3480de79f
Reviewed-on: http://review.typo3.org/38749
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php

index 9c6d40c..715700a 100644 (file)
@@ -151,7 +151,7 @@ class DataMapFactory implements \TYPO3\CMS\Core\SingletonInterface {
        protected function resolveTableName($className) {
                $className = ltrim($className, '\\');
                if (strpos($className, '\\') !== FALSE) {
-                       $classNameParts = explode('\\', $className, 6);
+                       $classNameParts = explode('\\', $className);
                        // Skip vendor and product name for core classes
                        if (strpos($className, 'TYPO3\\CMS\\') === 0) {
                                $classPartsToSkip = 2;