Possible bug in eztemplatecompiler.php

Author Message

John Strandmyr

Wednesday 14 October 2009 3:06:32 am

When i enable templateCompile, the usage of eztemplatecompiler.php in lib/ creates an error as it uses ezutils/classes/ezphpcreator.php's function thisVariableText which in turn creates an invalid phpstring like this one:

"Variable "valid_nodes" is already defined"

This results in a fatal PHP-error and displays no EZ-errormsg as the fatal error causes the whole script to die.

André R.

Wednesday 14 October 2009 5:44:38 am

What is the template code that triggers this?

I guess your referring to this code:

$php->addCodePiece( "    \$tpl->warning( '" . eZTemplateDefFunction::DEF_FUNCTION_NAME . "', \"Variable $variableNameText is already defined.\", " . $php->thisVariableText( $variablePlacement ) . " );\n" );

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

John Strandmyr

Wednesday 14 October 2009 7:45:41 am

Yes, that is correct. Thanks for adding that to the thread :-) I have also confirmed that the same code-snippet is in the newest stable release, 4.2.0

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 31 2025 06:20:28
Script start
Timing: Jan 31 2025 06:20:28
Module start 'layout'
Timing: Jan 31 2025 06:20:28
Module start 'content'
Timing: Jan 31 2025 06:20:28
Module end 'content'
Timing: Jan 31 2025 06:20:28
Script end

Main resources:

Total runtime0.0112 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2500151.2266
Module start 'layout' 0.00450.0018 739.476636.6641
Module start 'content' 0.00630.0038 776.140690.1719
Module end 'content' 0.01010.0011 866.312533.9922
Script end 0.0112  900.3047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002119.0596140.0002
Check MTime0.00109.3104140.0001
Mysql Total
Database connection0.00075.850810.0007
Mysqli_queries0.001816.189330.0006
Looping result0.00000.080610.0000
Template Total0.00097.910.0009
Template load0.00076.268410.0007
Template processing0.00021.564510.0002
Override
Cache load0.00054.108310.0005
General
dbfile0.00108.534580.0001
String conversion0.00000.053040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs