[TYPO3-english] clear_cachecmd and cachingframork problem

Christian Kuhn lolli at schwarzbu.ch
Tue Oct 9 17:24:39 CEST 2012


Hey,

On 10/09/2012 04:44 PM, Rachel Foucard wrote:
> after and 4.4 -> 4.5 upgrade and a new cachingframework setting in the
> install tool, a wesite that use comments plugin has a strange problem :
>
> When using the notification functionnality, sending a mail with a deleting
> link, there is a clear->cachecmd of the page id of the comment to delete.
> Then, an error message appear now : #1203699034: A cache with identifier
> "cache_pages" does not exist.
> but the configuration is good in the configuration board i have an array for
> : $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pages'];
>
> the comment is deleted, but the cache of the page is simply not cleared.
>
> so I really don't understand the problem... an Idea ?

Yes: In 4.5, if the cf is initialized, it does not necessarily mean that 
*all* caches are known to the system and available.

Your exception is probably thrown from tcemain #7027 in $pageCache = 
$GLOBALS['typo3CacheManager']->getCache('cache_pages'), because I think 
the link in ext:comments mail triggers an eid script, and eid does not 
initialize those caches by default like other scopes (fe and be).

The code should actually catch a NoSuchCache exception in 4.5 core 
branch at this point and initialize the cache as shown in code example
http://wiki.typo3.org/Caching_framework#Cache_registration_and_usage_for_extensions_supporting_TYPO3_4.3_and_above 
method "initializeCache".

This bug affects *only* 4.5 and does not occur sinc 4.6 anymore, because 
since 4.6 *all* defined caches are *always* known to the system in *any* 
scope.


You have the following options:

a) no not enable cf in 4.5

b) hack ext:comments to catch the exception, initialize the cache like 
in the docu example above, and call clearCache again.

c) hack core to correctly handle the possible exception, maybe create a 
patch for this and push to gerrit (but since it is "only" 4.5 I'm a bit 
unsure if it will be accepted and merged in time)

d) Register in core for the nearby hook "clearPageCacheEval" ~ line 
7015, and take care of cache initialization for the code below on your 
own this way (this would be a clean and quick way to circumvent the issue).

e) upgrade to 4.7 ...


Regards
Christian


More information about the TYPO3-english mailing list