[2.0.0-rc3]  Duplicate blocks when nested ComponentLayout with Layout Builder

Created on 24 January 2025, 5 months ago

Problem/Motivation

Found by Grimreaper:

  • I build a content block display with layout builder with an SDC as layout
  • I build a node display with layout builder with another SDC as layout, and I put the content block in a slot
  • The blocks placed in the slots of the first SDC (the one in the content block display) are duplicated on rendering

Proposed resolution

Prevent duplication.

🐛 Bug report
Status

Active

Version

2.0

Component

UI Patterns Layouts

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @pdureau
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France just_like_good_vibes PARIS

    i will take that one

  • Pipeline finished with Success
    5 months ago
    Total: 579s
    #405092
  • 🇫🇷France pdureau Paris

    Let's review this very carefully. It is only one line of code for now, but Layouts plugins are used in some weird ways in Drupal, and we don't want to fix on one side to break in the other.

          $build[$region_name] = $regions[$region_name];
          $build[$region_name] = &$build['#slots'][$region_name];
    

    Also, let's update the comment before with tne new situation:

          // For layout builder we need to pass slots also
          // direct to the build array. They are needed to generate contextual
          // links and other surrounding markup.
          // This makes field layout forms empty.
          // Not sure how to handle this. Should we support field_layout?
    
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Thanks a lot for the bug fix!

    I confirm it fixes the issue.

  • 🇫🇷France just_like_good_vibes PARIS

    i let christian update the comment on the original code.
    i just posted the fix :)

  • 🇩🇪Germany Christian.wiedemann

    christian.wiedemann made their first commit to this issue’s fork.

  • 🇩🇪Germany Christian.wiedemann

    Looks good for me. Also field_layout with forms works now. Great. I added a check to test if the layout builder specifcs are added.

  • Pipeline finished with Success
    5 months ago
    Total: 726s
    #406134
  • Pipeline finished with Skipped
    3 months ago
    #459178
  • Pipeline finished with Failed
    2 months ago
    #483776
  • Pipeline finished with Failed
    2 months ago
    #483778
  • Pipeline finished with Failed
    2 months ago
    #483780
  • Pipeline finished with Running
    2 months ago
    #483790
  • Pipeline finished with Failed
    2 months ago
    Total: 1206s
    #483943
  • Pipeline finished with Failed
    2 months ago
    Total: 665s
    #484065
  • Pipeline finished with Failed
    2 months ago
    Total: 713s
    #484076
  • Pipeline finished with Failed
    2 months ago
    Total: 585s
    #484593
  • Pipeline finished with Failed
    2 months ago
    Total: 555s
    #487203
  • Pipeline finished with Failed
    2 months ago
    Total: 706s
    #487211
  • Pipeline finished with Failed
    2 months ago
    Total: 683s
    #487221
  • Pipeline finished with Failed
    2 months ago
    Total: 497s
    #487232
  • Pipeline finished with Failed
    2 months ago
    Total: 566s
    #487241
  • Pipeline finished with Failed
    2 months ago
    Total: 791s
    #487294
  • Pipeline finished with Failed
    2 months ago
    Total: 590s
    #487303
  • Pipeline finished with Failed
    2 months ago
    Total: 591s
    #487315
  • Pipeline finished with Failed
    2 months ago
    Total: 795s
    #487335
  • Pipeline finished with Failed
    2 months ago
    #488922
  • Pipeline finished with Canceled
    2 months ago
    #488931
  • Pipeline finished with Canceled
    2 months ago
    #488937
  • Pipeline finished with Failed
    2 months ago
    #488938
  • Pipeline finished with Failed
    2 months ago
    #488942
  • Pipeline finished with Failed
    2 months ago
    #488953
  • Pipeline finished with Failed
    2 months ago
    #488984
  • Pipeline finished with Failed
    2 months ago
    #488994
  • Pipeline finished with Failed
    2 months ago
    #489048
  • Pipeline finished with Failed
    2 months ago
    #489061
  • Pipeline finished with Success
    2 months ago
    Total: 691s
    #489127
  • Pipeline finished with Failed
    2 months ago
    Total: 720s
    #489224
  • Pipeline finished with Success
    2 months ago
    Total: 562s
    #489243
  • Pipeline finished with Failed
    2 months ago
    Total: 625s
    #489251
  • Pipeline finished with Canceled
    2 months ago
    Total: 189s
    #489338
  • Pipeline finished with Failed
    2 months ago
    Total: 1277s
    #489341
Production build 0.71.5 2024