Cache problem

Author Message

Sébastien Morel

Monday 26 March 2007 9:04:20 am

Hello,

The context is :

I have a classe : article, this class have differents attributes in particular a "objects relations".
The contributors can add differents objects to a article with this datatype.

This is the view_full article :

<div id="contenu">
	bla bla bla.......
	{include uri="design:outils.tpl"}
</div>
<div id="annexes">
	{include uri='design:objects_relations.tpl'}			
</div>

objects_relations.tpl :

{if is_set($node.data_map.relation_objects)}
	{foreach $node.data_map.relation_objects.content.relation_list as $relation}
			{let obj=fetch('content', 'object',hash('object_id', $relation.contentobject_id))}
				{content_view_gui view=line content_object=$obj}	
			{/let}
	{/foreach}
{/if}

and the view_line of the object :

{attribute_view_gui attribute=$object.data_map.body}
{if $object.data_map.keywords.content.keywords|contains('mykeywords')}
		{include uri='design:create.tpl'}
{/if}

create.tpl :

{set-block scope=root variable=cache_ttl}0{/set-block}
{let 
	user=fetch('user', 'current_user')
	myspecificnode=fetch('content','node',hash('node_id',ezini( 'NoeudsImportants', 'myspecificnode', 'oseo.ini' )))
}
	{if $user.is_logged_in}
		{let 
		
			access=fetch( 'content', 'list_count', hash( 'parent_node_id', $myspecificnode.node_id ) )
			myrub=fetch('content', 'list', hash('parent_node_id', ezini( 'Datas', 'nodeId', 'myspecificnode.ini' ))).0
			infosInvestisseurs=fetch('content','list',hash(
														'parent_node_id',$myrub.node_id,
														'limit',1,
														'class_filter_type',  'include',
														'class_filter_array', array( 'infos_investisseur' )
													)
								)
			$number=$infosInvestisseurs|count()	
		}
        	{cache-block keys=array($user.contentobject_id,$access,$number)}
        		{if $access|gt(0)}
					link to the section 
				{else}
					{let 
						
						}
						{if is_set($infosInvestisseurs.0)}
							link to edition of an objet
						{elseif $myrub.node_id|gt(0)}
							form for the creation of an object
						{/if}
					{/let}
				{/if}
			{/cache-block}
		{/let}
	{else}		
			link to login
	{/if}
{/let}

So, when I desactivate the cache everything is OK, but on the production plateform, the cache is activated and nothing works.

The test of the user logged_in works everytime, but the cache block bloc doesn't work.
In fact, I could believe it works because the array the everytime the same as the first generation of the cache but it shoudln't !!!

Ex: My User is logged_in, he is in a group which are not the right to access at the section. I add a location to my user in a group which have the right... and my user havn't the right.

Or, if my user have create a content, I want to create a link to the edit page of this content but the link is always a creation button, like if the cache was show....

I don't understand,I think is complicated to explain my problem but If you can help me I will be very happy !

Thanks

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sébastien Morel

Monday 26 March 2007 9:31:37 am

I try to simplify but when the cache is activate, I add a location to my user, I deconnect this user, and my template show the bad link, he show the link in the cache....

But the right is ok, If i go in the section I have the right... but my template is not correct...

.... :(

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 21 2025 20:45:44
Script start
Timing: Jan 21 2025 20:45:44
Module start 'layout'
Timing: Jan 21 2025 20:45:44
Module start 'content'
Timing: Jan 21 2025 20:45:44
Module end 'content'
Timing: Jan 21 2025 20:45:44
Script end

Main resources:

Total runtime0.0204 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 591.6094151.1953
Module start 'layout' 0.00810.0035 742.804736.6094
Module start 'content' 0.01170.0072 779.414194.2266
Module end 'content' 0.01880.0016 873.640633.9922
Script end 0.0204  907.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002713.3050140.0002
Check MTime0.00115.5109140.0001
Mysql Total
Database connection0.00073.642910.0007
Mysqli_queries0.004622.518330.0015
Looping result0.00000.145810.0000
Template Total0.00125.710.0012
Template load0.00094.328510.0009
Template processing0.00031.301410.0003
Override
Cache load0.00062.837110.0006
General
dbfile0.00031.427380.0000
String conversion0.00000.047840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs