Project

General

Profile

Actions

Bug #25086

closed

A cache with identifier "cache_hash" does not exist.

Added by Werner Trunk about 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2011-02-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

t3lib_page_cache.patch (1.28 KB) t3lib_page_cache.patch Administrator Admin, 2011-02-18 16:27
Actions #1

Updated by Albrecht Köhnlein about 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']) {

Actions #2

Updated by Mr. Hudson almost 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

Actions #3

Updated by Mr. Hudson almost 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

Actions #4

Updated by Mr. Hudson almost 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

Actions #5

Updated by Mr. Hudson almost 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

Actions #6

Updated by Mr. Hudson almost 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

Actions #7

Updated by Mr. Hudson almost 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

Actions #8

Updated by Michael Stucki almost 13 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF