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

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Sep 6 19:41:48 CEST 2007


Bernhard Kraft wrote: on 06.09.2007 17:01:

>> 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.
> 
> 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 ...
> so changing that and making a "silent log" would probably make it hard
> for some
> developers to debug errors ...
> I mean if you haven't cc_devlog installed the error/warning simply gets
> dropped.

The developers might be used to see the warning when something is wrong,
but it doesn't help them in any other way.

Better would be to catch the warning and generate a TYPO3 error which
can be either minimalistic for live-sites ("Database error...") to
"full-blown" for IPs coming from devMask (with stack trace etc). But
also doing a "die()" afterwards since nothing good can be expected after
having such a warning.

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list