Issue Bug Closed

#22791Function getTreeList would insert a duplicate entry if cache value is a empty string

Björn Paulsen 06/02/10, 16:22 updated 10/11/13, 13:08

Description

The function tslib_cObj::getTreeList (file class.tslib_content.php) insert a record into the database to cache his results.

If is the result a empty string ‘’, the cache check fails!

the Line 7341 must be change from
if (!empty($cacheEntry0[‘treelist’])) {

to
if (!empty($cacheEntry0[‘treelist’]) || $cacheEntry0[‘treelist’] == ‘’) {

Now will be generate this call a error:

$GLOBALS[“TSFE”]->cObj->getTreeList(35,1);
$GLOBALS[“TSFE”]->cObj->getTreeList(35,1);

UID 35 is a default page, without subpages.

SQL debug
caller t3lib_DB::exec_INSERTquery
ERROR Duplicate entry ‘3eca390262f23b50cd9b16f173750213’ for key ‘PRIMARY’
lastBuiltQuery INSERT INTO cache_treelist(md5hash,pid,treelist,tstamp) VALUES (‘3eca390262f23b50cd9b16f173750213’,‘35’,’‘,‘1275488363’)
debug_backtrace require#80 // tslib_fe->INTincScript#453 // tslib_fe->INTincScript_process#3175 // tslib_cObj->USER#3236 // tslib_cObj->callUserFunction#789 // call_user_func_array#6594 // tx_cmsfme_pi1->main# // menue->main#125 // tslib_cObj->getTreeList#92 // t3lib_DB->exec_INSERTquery#7463 // t3lib_DB->debug#184
(issue imported from #M14595)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.