Internal paragraph type selection does not work with exclude filter

Created on 13 August 2025, 3 days ago

Problem/Motivation

When using the “Exclude the selected below” filter option in the paragraphs field settings, the edit form works as expected, since the logic for that is mostly coming from the Paragraphs module. However, the internal logic of Paragraphs Table fails to incorporate that same logic and simply retrieves a list of all checked paragraph types to perform its filtering ($handler["target_bundles"]) leading to unexpected behavior in both the “Paragraph Tables” styled edit form and displayed table.

Steps to reproduce

  1. Do not check all available paragraph types in the paragraph field settings
  2. Check “Exclude the selected below” as the filter
  3. Use “Paragraph Tables” as the formatter for both form and view modes
  4. Add a few paragraphs of different types
  5. See that the view is broken in both the form and view

Proposed resolution

Retrieve the list of paragraph type bundles to allow with the same method as the paragraphs module does it, instead of the custom solution.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany lrwebks Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @lrwebks
  • 🇩🇪Germany lrwebks Porta Westfalica
  • 🇩🇪Germany lrwebks Porta Westfalica
  • 🇩🇪Germany lrwebks Porta Westfalica
  • 🇫🇷France lazzyvn paris

    Beaware/!\ The paragraph table is designed for a single paragraph type. You can select multiple paragraphs, but only the first one will be selected for display.

  • 🇩🇪Germany lrwebks Porta Westfalica

    That is correct, but the paragraph field settings allow to select / filter multiple paragraph types. In that case, using the “Paragraphs Table” formatter on the form view should prevent any other paragraph types from being added. (The view formatter actually works well, as it creates a separate table for every type added to the paragraphs field, so why not just change the type filtering behavior and call it a day?)

    As it stands right now, a user is able to evoke undefined behavior in the module without changing code, and that is a bug, regardless of the module's purpose or design.

    That said, we would nonetheless be eager to propose a solution to this as soon as we have the time. :)

  • 🇩🇪Germany Anybody Porta Westfalica

    Yeah this is clearly a bug with the (newer)

    Exclude the selected below

    setting on the paragraphs field. Should work in both directions and use the same logic as paragraphs itself uses, from my perspective.

    Still @lazzyvn is totally correct with his point. It's focused on one type, otherwise creates separate tables due to the different fields = columns. We understand the reason and that shouldn''t be changed!

  • 🇩🇪Germany lrwebks Porta Westfalica

    Alright, in that case we should probably prevent the user from adding more than one different paragraph type to the form field. That would be my first thought on a possible solution at least. We somehow have to prevent that buggy result, but I can totally understand if we so not want to undermine the module's design here.

  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica

    Alright, understandable that we don't want to undermine the module's core concepts here. But the proposed solution should still work with that, wouldn't it?

    Yes, it's just a clean bugfix, that still makes sense IMHO. Not changing the module logics at all.

  • Merge request !16Resolve #3541116 "Internal paragraph type" → (Closed) created by lrwebks
  • Pipeline finished with Success
    3 days ago
    Total: 143s
    #572087
  • 🇫🇷France lazzyvn paris

    Oh I think fixed it is not complicate
    in widget/formatter looking for target_bundles just check handler_settings[negate] and use array_reverse.

    • lazzyvn committed ae464a7b on 2.x
      Issue #3541116: Internal paragraph type selection does not work...
    • 95007eaf committed on 2.x
      Issue #3541116: Internal paragraph type selection does not work...
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks for the fix @lazzyvn! That was fast!!

Production build 0.71.5 2024