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)
|