Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
4.3.0
-
None
-
Operating System: Linux
PHP Version: 5.3.8
Database and version: 5.5.13
Browser (and version):
Description
The subTreeExpiry parameter is ignored when eZFS or eZFS2 handlers are in use.
It is therefore not possible to create cache-blocks with working subTreeExpiry in PHP at this stage.
*eZTemplateCacheBlock::handle()* contains the following check:
if ( $cacheHandler instanceof eZDBFileHandler or $cacheHandler instanceof eZDFSFileHandler ) { $subtreeExpiry = eZTemplateCacheBlock::getSubtreeModification( $nodeID ); }
which shows subTreeExpiry only being used for eZDB and eZDBFS handlers.
Changing this code by removing the conditional around it results in the subTreeExpiry working correctly for eZFS.
Since *eZTemplateCacheBlock::getSubtreeModification()* exits immediately if $nodeID isn't set (i.e. subTreeExpiry not used), this fix should have no adverse results.
Steps to reproduce
Use the following code to create a cache-block with subTreeExpiry.
*eZTemplateCacheBlock*
list($handler, $data) = eZTemplateCacheBlock::retrieve( array( 'my_cool_key', $id, ), $nodeID, null ); if ( !$data instanceof eZClusterFileFailure ) { echo $data; } else { // ... generate the data $data = '...'; $handler->storeCache( array( 'scope' => 'template-block', 'binarydata' => $data ) ); }
Result: Updating child object of $nodeID does not trigger cache expiry.
Expected result: Updating child object of $nodeID triggers cache expiry.