Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (revision 7369) +++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy) @@ -7462,26 +7463,39 @@ } $GLOBALS['TYPO3_DB']->sql_free_result($res); } - } - // If first run, check if the ID should be returned: - if (!$recursionLevel) { - if ($addId) { - if ($begin > 0) { - $theList.= 0; - } else { - $theList.= $addId; + + // If first run, check if the ID should be returned: + if (!$recursionLevel) { + if ($addId) { + if ($begin > 0) { + $theList.= 0; + } else { + $theList.= $addId; + } } + + if (count($cacheEntry) > 0) { + $GLOBALS['TYPO3_DB']->exec_UPDATEquery( + 'cache_treelist', + 'md5hash=\'' . $requestHash . '\'', + array( + 'treelist' => $theList, + 'tstamp' => $GLOBALS['EXEC_TIME'] + ) + ); + } + else { + $GLOBALS['TYPO3_DB']->exec_INSERTquery( + 'cache_treelist', + array( + 'md5hash' => $requestHash, + 'pid' => $id, + 'treelist' => $theList, + 'tstamp' => $GLOBALS['EXEC_TIME'] + ) + ); + } } - - $GLOBALS['TYPO3_DB']->exec_INSERTquery( - 'cache_treelist', - array( - 'md5hash' => $requestHash, - 'pid' => $id, - 'treelist' => $theList, - 'tstamp' => $GLOBALS['EXEC_TIME'], - ) - ); } // Return list: return $theList;