Forums / Developer / Possible bug in eztemplatecompiler.php

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

eZ debug

Timing: Jan 18 2025 19:27:07
Script start
Timing: Jan 18 2025 19:27:07
Module start 'content'
Timing: Jan 18 2025 19:27:07
Module end 'content'
Timing: Jan 18 2025 19:27:07
Script end

Main resources:

Total runtime0.0194 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.8125180.8281
Module start 'content' 0.00730.0053 768.640693.9141
Module end 'content' 0.01260.0067 862.554770.7031
Script end 0.0193  933.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002110.8764120.0002
Check MTime0.00105.1685120.0001
Mysql Total
Database connection0.00052.701010.0005
Mysqli_queries0.004121.382940.0010
Looping result0.00000.138920.0000
Template Total0.006232.210.0062
Template load0.00136.592710.0013
Template processing0.005025.580610.0050
Override
Cache load0.00094.669610.0009
General
dbfile0.00042.1296100.0000
String conversion0.00000.040630.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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