Bug #21543
closedt3lib_cache_exception_NoSuchCache exception is not thrown
0%
Description
When trying to create a cach that does not exist with the following code, and the caching framework disabled in typo3 by setting useCachingFramework to zero:
if (!($GLOBALS['typo3CacheManager'] instanceof t3lib_cache_Manager)) {
$GLOBALS['typo3CacheManager'] = t3lib_div::makeInstance('t3lib_cache_Manager');
}
$pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
It is expected that the t3lib_cache_exception_NoSuchCache exception is thrown, on error, but currently TYPO3 crashes with the following error message:
Fatal error: Call to a member function create() on a non-object in TYPO3_4_3/t3lib/class.t3lib_cache.php on line 62
I am using the trunk version, checked out a few minutes ago: Revision 6409
(issue imported from #M12579)
Updated by Oliver Hader about 15 years ago
It's written in NEWS.txt:
If you use the caching framework it is not possible anymore to query the cache tables directly.
Any extension that needs the new caching framework has to make sure that it is initialized by
calling t3lib_cache::initializeCachingFramework().
Thus, call t3lib_cache::initializeCachingFramework() from your extensions before you want to use and access the caching framework and everything should be fine again.
Updated by Anonymous about 15 years ago
But doesn't this activate the caching framework for the whole TYPO3 installation?
Updated by Anonymous about 15 years ago
This bug can be closed as invalid, since it was caused by our wrong usage of the caching framework.
Updated by Oliver Hader about 15 years ago
Thanks for your feedback. This bug will be closed...