Fixed bug #12231: New caching framework (4.3-dev) does not work with DBAL
authorXavier Perseguers <typo3@perseguers.ch>
Tue, 3 Nov 2009 12:17:45 +0000 (12:17 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 3 Nov 2009 12:17:45 +0000 (12:17 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@26115 735d13b6-9817-0410-8766-e36946ffe9aa

typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_t3lib_db.php
typo3/sysext/dbal/class.ux_t3lib_sqlparser.php

index 901c91e..e35d695 100644 (file)
@@ -1,3 +1,7 @@
+2009-11-03  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Fixed bug #12231: New caching framework (4.3-dev) does not work with DBAL
+
 2009-10-28  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Added code to log all deprecated method calls
index 9639824..d9683e2 100644 (file)
@@ -1041,6 +1041,14 @@ class ux_t3lib_DB extends t3lib_DB {
                                if (!is_numeric($where_clause[$k]['field'])) {
                                        $where_clause[$k]['field'] = $this->quoteName($where_clause[$k]['field']);
                                }
+                               if (isset($where_clause[$k]['calc_table'])) {
+                                       if ($where_clause[$k]['calc_table'] != '') {
+                                               $where_clause[$k]['calc_table'] = $this->quoteName($where_clause[$k]['calc_table']);
+                                       }
+                                       if ($where_clause[$k]['calc_field'] != '') {
+                                               $where_clause[$k]['calc_field'] = $this->quoteName($where_clause[$k]['calc_field']);
+                                       }
+                               }
                        }
                        if ($where_clause[$k]['comparator']) {
                                        // Detecting value type; list or plain:
index 541f2e7..73c5d71 100644 (file)
@@ -375,7 +375,12 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                                                break;
                                                                }
                                                        } elseif ($v['calc']) {
-                                                               $output .= trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . $v['calc'] . $v['calc_value'][1] . $this->compileAddslashes($v['calc_value'][0]) . $v['calc_value'][1];
+                                                               $output .= trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . $v['calc'];
+                                                               if (isset($v['calc_table'])) {
+                                                                       $output .= trim(($v['calc_table'] ? $v['calc_table'] . '.' : '') . $v['calc_field']);
+                                                               } else {
+                                                                       $output .= $v['calc_value'][1] . $this->compileAddslashes($v['calc_value'][0]) . $v['calc_value'][1];
+                                                               }
                                                        } elseif (!($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8') && $v['comparator'] === 'LIKE' && $functionMapping)) {
                                                                $output .= trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']);
                                                        }