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

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