Fixed bug #12928: SQL error in translationCount() if table does not provide deleted...
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 9 Jan 2010 14:57:59 +0000 (14:57 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 9 Jan 2010 14:57:59 +0000 (14:57 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6740 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php

index d4ae08e..f7ad8ca 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-01-09  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #12928: SQL error in translationCount() if table does not provide deleted field (Thanks to Georg Ringer)
        * Fixed bug #12507: (Un)Install icon points to wrong extension in Opera (Thanks to Steffen Gebert)
 
 2010-01-08  Steffen Kamper  <info@sk-typo3.de>
index 613e656..0583010 100644 (file)
@@ -3568,12 +3568,18 @@ final class t3lib_BEfunc {
                                $GLOBALS['TCA'][$table]['ctrl']['languageField'] &&
                                $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] &&
                                !$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable']) {
+
+                       $where = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] . '=' . intval($ref) .
+                               ' AND ' . $GLOBALS['TCA'][$table]['ctrl']['languageField'] . '!=0';
+
+                       if (!empty($GLOBALS['TCA'][$table]['ctrl']['delete'])) {
+                               $where .= ' AND ' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0';
+                       }
+
                        $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
                                '*',
                                $table,
-                               $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] . '=' . intval($ref) .
-                                       ' AND ' . $GLOBALS['TCA'][$table]['ctrl']['languageField'] . '!=0' .
-                                       ' AND ' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0'
+                               $where
                        );
                }