Problems with TemplateCompile

Author Message

Christian Johansen

Tuesday 28 March 2006 2:36:34 am

Hi, I have a site that's just ready to go live. I turn on all cahing and it works fine, except when I use templateCompile. For some reason it fails to resolve all overrides when enabling this option, resulting in some pages not looking right. I have this in most of my full-templates:

{include uri="design:sub_nav_menu.tpl" node_id=$node.parent_node_id url_alias=$node.url_alias view='line'}

Which fetches a template that loops through the children like this:

{*
 Display children in a left hand meny

 Input:
 $node_id - The node id of the node whose children should be listed
 $url_alias - An url alias to pass to the node view gui
 $sort_by - Array with sort_by parameters
*}
{default $node_id = 0
	 $url_alias = ''
	 $sort_by = array( 'name', false() )
         $view = 'line'
}
{let children=fetch(content, list, hash(parent_node_id, $node_id,
                                   sort_by, $sort_by ))}
{if gt($children|count, 0)}

    <div class="section menu">
     <ul>
{/if}
  {foreach $children as $child sequence array(alt,) as $class}
    {node_view_gui view=$view content_node=$child alt=$class url=$url_alias}

  {/foreach}
{if gt($children|count, 0)}

     </ul>
    </div>
{/if}
{/let}

This works fine for "line"-view, but by the time I get to the page that uses "nav_line"-view it looks messed up. Am I missing something here? Without compiling it works like a charm.

Łukasz Serwatka

Tuesday 28 March 2006 10:15:51 pm

Do you mean when view cache is enabled?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Christian Johansen

Wednesday 29 March 2006 3:48:21 am

No, it works fine with view cache and caching, but as soon as I enable templatecompile it messes up the overrides.

Siniša Šehović

Thursday 08 June 2006 5:57:10 am

Hi

I have the same problem.
After enable templatecompile I can't see images in articles.

S.

---
If at first you don't succeed, look in the trash for the instructions.

Nathalie Grimaud

Thursday 18 January 2007 2:30:35 am

Any news about this issue?
In my case, just like Christian when I set TemplateCompile = enabled all the override rules are lost.

J-A Eberhard

Thursday 18 January 2007 3:10:49 am

Salut Nathalie,

Could it be related to this?
http://issues.ez.no/IssueView.php?Id=9781&activeItem=3
Getting away the user sensitive cache-blocks in the pagelayout.tpl solved my templateCompile problem.

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Nathalie Grimaud

Thursday 18 January 2007 3:57:12 am

Hi J-A,

for me it's not related to cache-blocks because even if I remove all of them I still can't see my override rules applied.
The only solution I found is set TemplaceCache=disabled.
Nevertheless thanks a lot for your suggestion.

Nathalie

Xavier Dutoit

Thursday 18 January 2007 9:26:03 am

Hi,

What's you're version of ez ?

Enable the debug display and clear all the cache then reload your page. Any error/warning ?

X+

http://www.sydesy.com

Nathalie Grimaud

Friday 19 January 2007 12:10:53 am

Hi Xavier,

I use eZ 3.9.0

Here is the only php warning I've got:
<i>
Array to string conversion in c:\ezpublish\htdocs\var\mysite\cache\template\compiled\pagelayout-f602be58cf32ecd4128484dd11f4c1de.php on line 436 </i>(it's the second one in the following code)

if ( is_array( $cacheKeys ) )
    $cacheKeys = implode( '_', $cacheKeys ) . '_';
else
    $cacheKeys .= '_';

Some more details:
My settings are

[ContentSettings]
ViewCaching=enabled
[TemplateSettings]
TemplateCompile=enabled
TemplateCache=enabled
[OverrideSettings]
Cache=enabled

I use some cache-blocks in pagelayout

The only override rules that are not applied have this structure

[my_override_rule]
Source=my_default_template.tpl
MatchFile=my_override_template.tpl
Subdir=templates
Match[class_group]=5

The ones with Source=node/view/... work fine

Thanks for your help
Nathalie

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 18 2025 21:07:52
Script start
Timing: Jan 18 2025 21:07:52
Module start 'layout'
Timing: Jan 18 2025 21:07:52
Module start 'content'
Timing: Jan 18 2025 21:07:53
Module end 'content'
Timing: Jan 18 2025 21:07:53
Script end

Main resources:

Total runtime0.9334 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.9141152.6250
Module start 'layout' 0.00480.0031 740.539139.4453
Module start 'content' 0.00780.9239 779.9844771.8750
Module end 'content' 0.93170.0016 1,551.859420.1641
Script end 0.9333  1,572.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3781160.0002
Check MTime0.00150.1606160.0001
Mysql Total
Database connection0.00060.061110.0006
Mysqli_queries0.851191.1813830.0103
Looping result0.00090.0963810.0000
Template Total0.892495.620.4462
Template load0.00220.235320.0011
Template processing0.890295.370220.4451
Template load and register function0.00020.020310.0002
states
state_id_array0.00630.673010.0063
state_identifier_array0.00090.101720.0005
Override
Cache load0.00190.2054560.0000
Sytem overhead
Fetch class attribute can translate value0.00070.078160.0001
Fetch class attribute name0.00140.1452130.0001
XML
Image XML parsing0.00230.245360.0004
class_abstraction
Instantiating content class attribute0.00000.0026130.0000
General
dbfile0.00390.4153340.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 46
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs