Project

General

Profile

Actions

Bug #21797

closed

SQL error in translationCount() if table does not provide deleted field

Added by Kurt Gusbeth over 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
Start date:
2009-12-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Like you can see at "Additional Information", you will get a MySQL-Error message when there is no deleted-field in a table.
This is the error-message I get:

t3lib_DB::exec_SELECTquery
ERROR
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=0' at line 1
lastBuiltQuery
SELECT COUNT FROM tx_myquizpoll_result WHERE l10n_parent=100 AND sys_language_uid!=0 AND =0

I didnĀ“t get this error message in typo3 version 4.2.10 !
Please check if $GLOBALS['TCA'][$table]['ctrl']['delete'] is set !

public static function translationCount($table, $ref, $msg = '') {
if (empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable']) &&
$GLOBALS['TCA'][$table]['ctrl']['languageField'] &&
$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] &&
!$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable']) {
$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'
);
}
return ($count ? ($msg ? sprintf($msg, $count) : $count) : '');
}
(issue imported from #M12928)

Files

12928-deleted-records.patch (1.05 KB) 12928-deleted-records.patch Administrator Admin, 2009-12-11 11:37
T3X_test12928.t3x (9.93 KB) T3X_test12928.t3x Administrator Admin, 2009-12-11 11:38
Actions #1

Updated by Kurt Gusbeth over 14 years ago

The error occurs in the "Web" -> "List" view mode.

Actions #2

Updated by Georg Ringer over 14 years ago

test extension attached

Actions #3

Updated by Christian Kuhn over 14 years ago

  • Committed to trunk rev. 6740
  • Committed to TYPO3_4-3 rev. 6741
Actions

Also available in: Atom PDF