Monday 10 September 2007 12:43:41 am
Thank you for your reply.
I tried to enable / disable the UseFormatting setting, but it doesn't seem to do the trick. Well, I should say, I don't see any difference in the html source. (The setting TemplateCompile is enabled though.) When I first changed the UseFormatting setting, ezP generated bad code in the compiled templates. (I'm using ezP 3.9.2) I got an unexpected T_String error, so I had to look into the compiled templates. The content of $variableNameText in line 2698 of /lib/eztemplate/classes/eztemplatecompiler.php contains double quotes, resulting in something like this:
$tpl->warning("Variable "testvar" is already define.");
The original code of eztemplatecompiler.php
$php->addCodePiece( " \$tpl->warning( '" . EZ_TEMPLATE_DEF_FUNCTION_NAME . "', \"Variable $variableNameText is already defined.\" );\n" );
I used a quick fix to replace double quotes by single quotes, to prevent this
$php->addCodePiece( " \$tpl->warning( '" . EZ_TEMPLATE_DEF_FUNCTION_NAME . "', \"Variable ".str_replace("\"", "'", $variableNameText)." is already defined.\" );\n" );
Now the generated code should look like this:
$tpl->warning("Variable 'testvar' is already define.");
Not sure why this bug suddenly appeared when changing the UseFormatting setting, but anyway, with this fixed, I'm still having empty lines and whitespace in the html source. Is there something else other than TemplateCompile that could have effect on UseFormatting?
|