Using Rocketship layouts and paragraphs causes paragraphs to go through rendering twice. (this in turn causes issues with advanced forms if you have a paragraph that references a form)

  {% if content.top is not empty and content.top|render|striptags|length %}
    <div class="layout__region layout__top {{'layout__' ~ 'top' ~ '--' ~ entityType ~ '--' ~ bundle ~ '--' ~ viewMode }}">
      {{ content.top }}
    </div>
  {% endif %}

This extra check where the content is rendered in the template causes the issue. When I remove that extra check the build is rendered correctly.

CommentFileSizeAuthor
#4 31376601-4.patch13.89 KBnielsaers
#2 31376601-2.patch12.11 KBnielsaers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nielsaers created an issue. See original summary.

nielsaers’s picture

FileSize
12.11 KB

Created a quick patch that removes the logic for rendering the content in the templates. It might need some looking into why the empty check was not enough.

nielsaers’s picture

nielsaers’s picture

FileSize
13.89 KB

Created another patch that actually brings back the functionality of conditional regions but only renders the output once. So the downside is that the entire contents get rendered in the twig file.

As with the related issue, there is no real fix yet that takes into account all the edge cases. (e.g. bigpipe,...)

Resources: https://www.lullabot.com/articles/level-your-twiggery#checking-field-is-...

nielsaers’s picture

  • rembrandx committed 13dd29f on 8.x-3.x
    [#3137601] fix double rendering issue logged on drupal.org
    
rembrandx’s picture

Status: Active » Fixed

Patch 4 applied and adding to new release (alpha 6), thanks @Niels! Sorry it took a while to get in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

nginex’s picture

Version: 8.x-1.1-beta16 » 8.x-1.x-dev

Backported existing patch to 8.x-1.x, will be available in new release