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
Updated by Albrecht Köhnlein over 13 years ago
I just fixed the problem in mm_forum by changing line 145 from
if($GLOBALS['TYPO3_CONF_VARS']['SYS']['useCachingFramework']) {
into
if(isset($GLOBALS['typo3CacheManager']) && $GLOBALS['TYPO3_CONF_VARS']['SYS']['useCachingFramework']) {
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change Idafbcf0983fc189c5f71999a10c04ec4fd340f2b has been pushed to the review server.
It is available at http://review.typo3.org/3065
Updated by Mr. Hudson over 13 years ago
Patch set 2 of change Idafbcf0983fc189c5f71999a10c04ec4fd340f2b has been pushed to the review server.
It is available at http://review.typo3.org/3065
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change Idafbcf0983fc189c5f71999a10c04ec4fd340f2b has been pushed to the review server.
It is available at http://review.typo3.org/3066
Updated by Mr. Hudson over 13 years ago
Patch set 3 of change Idafbcf0983fc189c5f71999a10c04ec4fd340f2b has been pushed to the review server.
It is available at http://review.typo3.org/3065
Updated by Mr. Hudson over 13 years ago
Patch set 2 of change Idafbcf0983fc189c5f71999a10c04ec4fd340f2b has been pushed to the review server.
It is available at http://review.typo3.org/3066
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change Iaeae13fe756b9b230f3eea919eaa3f045f2a6dcf has been pushed to the review server.
It is available at http://review.typo3.org/3068
Updated by Michael Stucki over 13 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset e13f2bebb7debe5fc73caa837c9b347a77f7189d.