error only in cached template

Author Message

j jevack

Wednesday 18 January 2006 9:25:27 am

Greetings All,

I'm experiencing an odd problem: the template executes correctly when the cache is cleared. However when ezp runs the cached template, it throws an error.

error:
array_keys(): The first argument should be an array in /usr/local/apache2/htdocs/ez_rmu/var/plain/cache/template/compiled/content_business_home-e9b6c83fd17eba0ede6f52b6b730178a.php on line 1368

if it'll help here's the code:

{let department_schools=fetch(content, list, hash(parent_node_id, $node.node_id))}
	{foreach $department_schools as $school}
	  {if $school.object.class_name eq('Page')}
		
		<A HREF={$school.url_alias|ezurl}><IMG SRC={"/images/general_pointer.gif"|ezdesign} width=20 height=11 border=0 vspace=3></A>

		<A HREF={$school.url_alias|ezurl}>{$school.name}</A>

	   {/if}
	 {/foreach}
{/let}

Thanks in advance,

Jason

j jevack

Wednesday 18 January 2006 12:44:41 pm

I fixed the problem and I think it was using $node variable in a page layout template. When I replaced the $node.node_id variable in the first line with $module_result.content_info.node_id everything works fine.

Is this because $node is only available in a content view? Why would it work when not cached and only have problems when executing a cached template?

Thanks

Jason

Esteban Rodriguez

Wednesday 18 January 2006 1:16:02 pm

Thats exactly the problem, $node is not available outside $module_result and you notice it when the cache is turned on.

Check this page out, its quite handy:
http://ez.no/doc/ez_publish/technical_manual/3_6/templates/the_pagelayout/variables_in_pagelayout

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

j jevack

Thursday 19 January 2006 3:40:25 am

Thanks for the explanation Esteban. That makes sense.

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 11:24:24
Script start
Timing: Jan 18 2025 11:24:24
Module start 'layout'
Timing: Jan 18 2025 11:24:24
Module start 'content'
Timing: Jan 18 2025 11:24:25
Module end 'content'
Timing: Jan 18 2025 11:24:25
Script end

Main resources:

Total runtime0.6751 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.9063152.6250
Module start 'layout' 0.00640.0021 740.531339.4453
Module start 'content' 0.00850.6649 779.9766541.3203
Module end 'content' 0.67330.0017 1,321.296912.4766
Script end 0.6751  1,333.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5236160.0002
Check MTime0.00150.2225160.0001
Mysql Total
Database connection0.00140.201710.0014
Mysqli_queries0.626092.7251600.0104
Looping result0.00050.0789580.0000
Template Total0.646095.720.3230
Template load0.00190.284720.0010
Template processing0.644195.412420.3221
Template load and register function0.00030.038410.0003
states
state_id_array0.00090.130010.0009
state_identifier_array0.00080.119120.0004
Override
Cache load0.00170.2446230.0001
Sytem overhead
Fetch class attribute can translate value0.00130.189320.0006
Fetch class attribute name0.00120.176950.0002
XML
Image XML parsing0.00060.096220.0003
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00080.1153160.0000
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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs