Issue Bug Closed

#24951Debugging database errors breaks with this (formerly correct) code: $GLOBALS['TYPO3_DB']->debugOutput = true;

Markus Kappe 02/04/11, 11:13 updated 02/26/11, 01:11

Description

In class t3lib_DB on line ~ 134 it says
var $debugOutput = FALSE; // Set “TRUE” if you want database errors outputted.

But this is not correct any more. Setting $debugOutput to true results in displaying sql error debugging messages when there is no error.

On line ~ 1435 (funtion debug) it says:
if ($error || $this->debugOutput 2) {
This always evaluates to true, since (true 2) is always true. So there is a debug output even when there is no error.

I suggest type-casting $this->debugOutput to integer before comparing it to the number “2”. And, of course, correct the comment on line ~ 134

Workaround for developers:

$GLOBALS[‘TYPO3_DB’]->debugOutput = 1;
(issue imported from #M17478)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.