Bug #25086
closedA cache with identifier "cache_hash" does not exist.
100%
Description
The extension tx_ratings, on rate item, gives the Error :
A cache with identifier "cache_hash" does not exist. class.t3lib_page.php, Line 980
Trigger is the Ajax request to a page with eID mechanism "class.tx_ratings_ajax.php",
where the only existing cache object is extbase,
and the page try to load a language file through:
$GLOBALS['LANG']->includeLLFile('EXT:ratings/locallang_ajax.xml');
this function leads to the caching request "getHash" in file class.t3lib_page.php
Since the function only checks for existence of the container object "typo3CacheManager"
it fails on use of the real, non existing, cache object "cache_hash".
Same with function "storeHash".
My solution : insert the statement : if (($GLOBALS['typo3CacheManager']->hasCache('cache_hash')))
----------------------------class.t3lib_page.php-------------------------
Line 975
public static function getHash($hash, $expTime = 0) {
$hashContent = null;
if (TYPO3_UseCachingFramework) {
if (is_object($GLOBALS['typo3CacheManager'])) {
if (($GLOBALS['typo3CacheManager']->hasCache('cache_hash'))){
$contentHashCache = $GLOBALS['typo3CacheManager']->getCache('cache_hash');
$cacheEntry = $contentHashCache->get($hash);
....
------------------------
Line 1018
public static function storeHash($hash, $data, $ident, $lifetime = 0) {
if (TYPO3_UseCachingFramework) {
if (is_object($GLOBALS['typo3CacheManager'])) {
if (($GLOBALS['typo3CacheManager']->hasCache('cache_hash'))){
$GLOBALS['typo3CacheManager']->getCache('cache_hash')->set(
$hash,
....
-----------------------------------------------------------------------------------
A bit similar is the mm_forum Error
A cache with identifier "cache_hash" does not exist.
caused by not enabled caching framework
and the code in
------------------ class.tx_mmforum_cache.php ------------
Line: 145
if(isset($GLOBALS['typo3CacheManager'])) {
$this->useTYPO3Cache = TRUE;
if($useMode == 'database')
$this->cacheObj =& $GLOBALS['typo3CacheManager']->getCache('cache_hash');
---------------------------------------------------------------------------------
And the same code exists in
typo3conf/ext/div2007/class.tx_div2007_div.php Line 2483
(issue imported from #M17651)
Files