Call to a member function templateValue() on a non-object in

Author Message

Adam Buczaj

Thursday 22 October 2009 2:44:41 am

Hi all,

I wanted to share some problem with you and ask did you also got this issue,
in apache error log I got sometimes after cache build errors like

PHP Fatal error:  Call to a member function templateValue() on a non-object in /var/www/html/example/var/ezwebin_site/cache/template/compiled/filename_template-ffa41dc1517a739baa7049c174aee3dc.php on line 394

and this happend for different filenames from time to time - and disappear after cache clear by command line, for me it looks like some hdd error on server or something in ez cache build system also I've notice in that complied php files - that this function for templateValue() is 'name' or 'Name'

$var1 = ( array_key_exists( $rootNamespace, $vars ) and array_key_exists( 'utilities_node', $vars[$rootNamespace] ) ) ? $vars[$rootNamespace]['utilities_node'] : null;
$var2 = compiledFetchAttribute( $var1, 'name' );
unset( $var1 );
$var1 = $var2;
if (! isset( $var1 ) ) $var1 = NULL;
while ( is_object( $var1 ) and method_exists( $var1, 'templateValue' ) )
    $var1 = $var1->templateValue();
while ( is_object( $var1 ) and method_exists( $var1, 'templateValue' ) )
    $var1 = $var1->templateValue();
$var = htmlspecialchars( $var1 );
unset( $var1 );
if (! isset( $var ) ) $var = NULL;
while ( is_object( $var ) and method_exists( $var, 'templateValue' ) )
    $var = $var->templateValue();  <===  this line is shown by apache error log 'on line'
$text .= $var;
unset( $var );

and this php is build by template normal loop foreach and display array or node by
{$node.name|wash()}

so do you think for name there should be allways {$object.name} instead of {$node.name}
?

any other idea?

(ez version 4.1.1)

Kind regards
Adam Buczaj

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 18:17:55
Script start
Timing: Jan 18 2025 18:17:55
Module start 'layout'
Timing: Jan 18 2025 18:17:55
Module start 'content'
Timing: Jan 18 2025 18:17:56
Module end 'content'
Timing: Jan 18 2025 18:17:56
Script end

Main resources:

Total runtime0.6543 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.6016152.6563
Module start 'layout' 0.00700.0036 742.257839.5078
Module start 'content' 0.01060.6424 781.7656439.5703
Module end 'content' 0.65300.0013 1,221.33598.0938
Script end 0.6543  1,229.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5144160.0002
Check MTime0.00130.2004160.0001
Mysql Total
Database connection0.00110.171810.0011
Mysqli_queries0.613193.6991460.0133
Looping result0.00040.0550440.0000
Template Total0.623695.320.3118
Template load0.00200.310720.0010
Template processing0.621694.993720.3108
Template load and register function0.00020.025710.0002
states
state_id_array0.00120.181110.0012
state_identifier_array0.00090.132520.0004
Override
Cache load0.00170.2569150.0001
Sytem overhead
Fetch class attribute can translate value0.00070.112810.0007
Fetch class attribute name0.00060.089910.0006
XML
Image XML parsing0.00020.032110.0002
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00180.2699100.0002
String conversion0.00000.001340.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs