[BUGFIX] Persistent classes with more than five name parts in extbase 56/39156/2
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 13:05:41 +0000 (15:05 +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>
(cherry picked from commit c4886bbf9197855bb39bfb6cf82117fcf159da81)
Reviewed-on: http://review.typo3.org/39156
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php

index 86e7cde..4741d10 100644 (file)
@@ -150,7 +150,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;