Duplicate blocks in Manage display

Created on 6 March 2025, 2 months ago

Problem/Motivation

After enabling ui_patterns_blocks I get duplicate and wrong entries when I try to selectively enable derived blocks in Manage display of a content type that is layoutbuilder enabled.

For instance I have my own SDC component my_components:audio, in the listing below UI Patterns -> "Allow specific UI Patterns blocks" I get

[] Audio
[] Audio

The markup for the first entry shows a key of:

name="layout_builder_restrictions[allowed_blocks][UI Patterns][available_blocks][ui_patterns_entity:hrw_components:audio]"

The second:

name="layout_builder_restrictions[allowed_blocks][UI Patterns][available_blocks][ui_patterns:hrw_components:audio]"

This could be explained by the two deriver classes. Should these be labelled differently so they can be distinguished?

Which one should be used in which context?

💬 Support request
Status

Active

Version

2.0

Component

UI Patterns Blocks [2.x only]

Created by

miiimooo Europe

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

Merge Requests

Comments & Activities

  • Issue created by @miiimooo
  • 🇫🇷France just_like_good_vibes PARIS

    ui_patterns_entity:x:x blocks are for layout builder and only appears in layout builder, because it requires an entity context to work.

    ui_patterns:x:x are global blocks without any context required, they won't show in layout builder by design (and by code).

    in which screen, by which contrib module, are the blocks shown twice? i guess this is where the code is wrong. Because when you properly require the list of blocks for layout builder, only one block per component is returned.

  • miiimooo Europe

    Thanks for clarifying. This is in core / field_ui, when configuring the display mode full, with layout builder enabled, so for example
    * create a content type
    * go to Manage display for the new content type /admin/structure/types/manage/article/display
    * enable "Use Layout Builder"
    * then in Blocks Available for Placement is where I get the duplicates

  • 🇫🇷France just_like_good_vibes PARIS

    Hello,
    thank you for clarification, indeed very strange, it seems like a regression.
    we need to figure this out. thank you for reporting. i will work on that one.

  • 🇫🇷France just_like_good_vibes PARIS

    i can't reproduce right now your issue.
    there is a code in ui_patterns_blocks in the .module which does this.
    The problem is introduced by "layout_builder_restrictions"...

  • 🇫🇷France just_like_good_vibes PARIS

    @miiimooo, let me know if the pushed code is solving something to your issue?
    i still can't reproduce on my side.

  • Pipeline finished with Failed
    2 months ago
    Total: 561s
    #447656
  • Pipeline finished with Success
    16 days ago
    Total: 571s
    #484638
Production build 0.71.5 2024