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

Fix the Twig Loader String usage

    XMLWordPrintable

Details

    Description

      AS pointed out by review by Sensio, current code will lead to new cache generated every time the content returned from legacy is different.
      The code causing the issue:

      # eZ\Publish\Core\MVC\Legacy\View\TwigContentViewLayoutDecorator
      $twigContentTemplate = <<<EOT
      {% extends "{$layout}" %}
      {% block {$options['contentBlockName']} %} {$contentViewClosure( $params )}
      {% endblock %}
      EOT;
      

      Two solutions are available:

      • Having a physical template and use it directly.
      • Changing the template above to display the content as a twig variable:
        $twigContentTemplate = <<<EOT
        {% extends "{$layout}" %}
        {% block {$options['contentBlockName']} %}
        {{ content|raw }}
        {% endblock %}
        EOT;
        

      Attachments

        Activity

          People

            Unassigned Unassigned
            andre.romcke-obsolete@ez.no André Rømcke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m