Fixed bug #16508: TCA tree is not compatible DBAL due to mySQL specific use of CONCAT
authorSteffen Ritter <info@rs-websystems.de>
Sun, 28 Nov 2010 08:47:32 +0000 (08:47 +0000)
committerSteffen Ritter <info@rs-websystems.de>
Sun, 28 Nov 2010 08:47:32 +0000 (08:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9661 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/tree/tca/class.t3lib_tree_tca_databasetreedataprovider.php

index 8e3821b..60eaa90 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Fixed bug #16342: TCA tree throws Fatal error on displaying deleted records
        * Fixed bug #16510: TCA tree should behave like select
+       * Fixed bug #16508: TCA tree is not compatible DBAL due to mySQL specific use of CONCAT
 
 2010-11-26  Francois Suter  <francois@typo3.org>
 
index 36be778..7b8940c 100644 (file)
@@ -415,9 +415,8 @@ class t3lib_tree_Tca_DatabaseTreeDataProvider extends t3lib_tree_Tca_AbstractTca
                                        $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                                                'uid',
                                                $columnConfiguration['foreign_table'],
-                                               " (CONCAT(','," . $columnConfiguration['foreign_field'] . ",',') LIKE '%," . intval($uid) . ",%' "
-                                               . (intval($uid) == 0 ? (" OR " . $columnConfiguration['foreign_field'] . " = ''") : '')
-                                               . ") "
+                                               $GLOBALS['TYPO3_DB']->listQuery($columnConfiguration['foreign_field'], intval($uid), $columnConfiguration['foreign_table'])
+                                                       . (intval($uid) == 0 ? (' OR ' . $columnConfiguration['foreign_field'] . ' = \'\'') : '' )
                                        );
                                        foreach ($records as $record) {
                                                $relatedUids[] = $record['uid'];
@@ -426,9 +425,8 @@ class t3lib_tree_Tca_DatabaseTreeDataProvider extends t3lib_tree_Tca_AbstractTca
                                        $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                                                'uid',
                                                $columnConfiguration['foreign_table'],
-                                               " (CONCAT(','," . $this->getLookupField() . ",',') LIKE '%," . intval($uid) . ",%' "
-                                               . (intval($uid) == 0 ? (" OR " . $this->getLookupField() . " = ''") : '')
-                                               . ") "
+                                               $GLOBALS['TYPO3_DB']->listQuery($this->getLookupField(), intval($uid), $columnConfiguration['foreign_table'])
+                                                       . (intval($uid) == 0 ? (' OR ' . $this->getLookupField() . ' = \'\'') : '' )
                                        );
                                        foreach ($records as $record) {
                                                $relatedUids[] = $record['uid'];
@@ -439,9 +437,8 @@ class t3lib_tree_Tca_DatabaseTreeDataProvider extends t3lib_tree_Tca_AbstractTca
                                $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                                        'uid',
                                        $columnConfiguration['foreign_table'],
-                                       " (CONCAT(','," . $this->getLookupField() . ",',') LIKE '%," . intval($uid) . ",%' "
-                                       . (intval($uid) == 0 ? (" OR " . $this->getLookupField() . " = ''") : '')
-                                       . ") "
+                                       $GLOBALS['TYPO3_DB']->listQuery($this->getLookupField(), intval($uid), $columnConfiguration['foreign_table'])
+                                               . (intval($uid) == 0 ? (' OR ' . $this->getLookupField() . ' = \'\'') : '' )
                                );
                                foreach ($records as $record) {
                                        $relatedUids[] = $record['uid'];