Project

General

Profile

Actions

Bug #24951

closed

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

Added by Markus Kappe about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2011-02-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)


Files

patch.txt (693 Bytes) patch.txt Administrator Admin, 2011-02-04 13:08
bug_17478.diff (1.19 KB) bug_17478.diff Administrator Admin, 2011-02-04 13:16
Actions #1

Updated by Ernesto Baschny about 13 years ago

Thanks for the report. Sounds reasonable.

Could you please provide a patch fixing that issue and submit it to the core list for review? Thanks a lot for your help!

Actions #2

Updated by Ernesto Baschny about 13 years ago

Committed Helmuts v2 to:

- trunk rev 10403
- 4-5 rev 10404 (for 4.5.1)

Actions

Also available in: Atom PDF