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

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Sep 7 09:54:10 CEST 2007


Bernhard Kraft schrieb:
> Martin Kutschker wrote:
> 
>> debug_check_recordset() tells the caller if there is a problem (it 
>> returns FALSE), yet this is not even used.
>>
> ...
>> This should, if we want to be save, more like that
>>
>> function sql_fetch_row($res)    {
>>    if ($this->check_mysql_result($res)) {
>>      return mysql_fetch_row($res);
>>    } else {
>>      return FALSE;
>>    }
>> }
> 
> I also thought about this - but as Dmitry wrote in his mail this is 
> probably not what the user wants.

Yoe mean "the developer".
> 
> Currently when you fetch records from an invalid mysql-result yout get a 
> PHP error message at the top of your page - this sometimes helps the developer to 
> know that (and where) an error occurs.
> 
> Everybody currently is used that he gets those warnings if a result is 
> not valid ...

Not checking a fuction result is an error... well, slopppy proggramming style.

> so changing that and making a "silent log" would probably make it hard 
> for some developers to debug errors ...

Anyway, we could use trigger_error() in that case. Maybe enabled with a 
config var setting.

Masi


More information about the TYPO3-team-core mailing list