[TYPO3-core] Fix for "debug_check_recordset" in t3lib_db
Bernhard Kraft
kraftb at kraftb.at
Wed Sep 5 22:28:18 CEST 2007
Hallo !
This is a SVN patch request.
Branch: Trunk
Problem:
In class.t3lib_db.php there is a new method introduced which performs checks if
the result-resource variable which is used for fetching rows (using ->sql_fetch_assoc
and similar) is checked if it is set.
Even if the variable contains for example a numeric "1" the check would not fail and
would give a mysql-error afterwards.
Additionaly the query which failed isn't logged to devLog - which would (in my opinion)
be another good feature helping debug.
Solution:
Use the PHP function "is_resource" to check wheter the given $res variable is a valid PHP
resource variable. Then use the PHP function "get_resource_type" to check wheter the variable
contains a valid "mysql result" resource-var.
I also added 3 lines which add the contents of TYPO3_DB member var "->debug_lastBuiltQuery"
to the debug-log line.
See attached diff.
PS: At least a patch/bugfix from me again :)
greets,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_t3lib_db_2007-09-05.diff
Type: text/x-patch
Size: 1012 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070905/fff17ee2/attachment.bin
More information about the TYPO3-team-core
mailing list