Forums / Developer / expiry time not ignored in cache-block with subtree_expiry

expiry time not ignored in cache-block with subtree_expiry

Author Message

Marko Žmak

Friday 11 August 2006 2:52:15 am

I'm using some cache blocks on my site and I have setup them to use subtree_expiry. The blocks are cached ok, but after some time (i think 2 hour) the cache blocks are cleared although I haven't changed anything in the content of the site. I belive this is a bug since the docs says:

<i>In other words, it will implicitly turn on the "ignore_content_expiry" and set the expiration time to zero.</i>

(http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_functions/miscellaneous/cache_block)

I took a lok at the cache script (lib/eztemplate/classes/eztemplatecachefunction.php) and found out this code:

                    if ( isset( $functionParameters['subtree_expiry'] ) )
                    {
                        $ignoreContentExpiry = true;
                    }

There's also a $expiryTime variable in the code but it's not used anywhere related to 'subtree_expiry' parameter.

I think that the code should be this way:

                    if ( isset( $functionParameters['subtree_expiry'] ) )
                    {
                        $ignoreContentExpiry = true;
			$expiryTime = 0;
                    }
		    else
		    {
	                    $expiryTime = $localExpiryTime;
        	            if ( $ignoreContentExpiry == false )
	                    {
	                        include_once( 'lib/ezutils/classes/ezexpiryhandler.php' );
	                        $handler =& eZExpiryHandler::instance();
	                        if ( $handler->hasTimestamp( 'template-block-cache' ) )
	                        {
	                            $globalExpiryTime = $handler->timestamp( 'template-block-cache' );
	                            $expiryTime = max( $localExpiryTime, $globalExpiryTime );
	                        }
        	            }
		    }

Am I right?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Monday 14 August 2006 1:04:22 am

I reported this as a bug:

http://ez.no/bugs/view/8817

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth