Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19160

eZTemplateCacheBlock's subTreeExpiry not working for eZFS handlers

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 4.3.0
    • Caching
    • 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.

      Attachments

        Activity

          People

            unknown unknown
            benk@mugo.ca benk@mugo.ca
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: