Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15665

Site fails when activating TemplateCompile-setting

    XMLWordPrintable

    Details

      Description

      When i activate TemplateCompile in the site.ini.append.php the compiled PHP-files contains an error. After what i have gathered the issue seems to be as follows:

      in /lib/eztemplate/classes/eztemplatecompiler.php::generatePHPCodeChildren there is a line that looks like this:

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

      This line uses $variableNameText that is created at this line in the same funciton:

      $variableNameText = $php->thisVariableText( $variableName, 0, 0, false );
      

      $php->thisVariableText returns a value with doublequotes. So if a $variableName initially was `myVariableName` it returns `"myVariableName"`.

      As you might understand, the generatePHPCodeChildren will fail as the quoting is wrong. In "human readable" version it results in a string like this in the compiled PHP-file:

      $tpl->warning( 'def', "Variable "template" is already defined." );

        Attachments

          Activity

            People

            • Assignee:
              patrick.allaert Patrick Allaert
              Reporter:
              strandmyr John Strandmyr
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: