[TYPO3-core] Fix for "debug_check_recordset" in t3lib_db

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Sep 7 10:12:42 CEST 2007


Dmitry Dulepov [typo3] schrieb:
> Martin Kutschker wrote:
>> Not checking a fuction result is an error... well, slopppy 
>> proggramming style.
> 
> There is no point to check error inside t3lib_db::sql_fetch_assoc(). It 
> is caller's responsibility!

Right. I was speaking against Bernahrd's argument that the "user" is used 
to the PHP warnings. It's debatable whether t3lib_db::sql_fetch_assoc() 
should do an input argument checking. But if it doesn't it shouldn't let 
any functions it calls "pollute" the script output.

> Just the same way as there is no point 
> aborting application inside PHP's mysql_fetch_assoc() if something 
> failed. Such functions cannot take decisions, they can only log them. 
> They are not at the point of decision taking.
> 
>> Anyway, we could use trigger_error() in that case. Maybe enabled with 
>> a config var setting.
> 
> No need. mysql_fetch_assoc does this and you will see it if 
> error_reporting is enabled. But if it is disabled, your trigger_error 
> will not be visible anyway. Existing solution works even if 
> error_reporting is disabled.

Why? I can use @ for mysql_fetch_assoc.

Masi


More information about the TYPO3-team-core mailing list