Conditional Fields not working when parent entity paragraph uses Layout Paragraphs widget

Created on 20 August 2025, 6 days ago

Problem/Motivation

When using Conditional Fields with Paragraphs, the conditions stop working if the parent paragraph is using the Layout Paragraphs widget.

For example:

  • A paragraph bundle contains a field that should control the visibility of another field using Conditional Fields.
  • If the parent entity is configured to use the Layout Paragraphs widget, the conditional logic does not trigger at all.
  • If the same paragraph is edited via the default Paragraphs widget, the conditional logic works as expected (fields hide/show properly).
  • If the parent entity is configured to use the Layout Paragraphs widget, the conditional logic does not trigger at all.

Steps to reproduce

  1. Enable Paragraphs, Layout Paragraphs, and Conditional Fields.
  2. Create a paragraph type with at least two fields:
    • field_toggle (boolean or select)
    • field_dependent (text, shown only when field_toggle = true).
  3. Configure Conditional Fields to show/hide field_dependent based on field_toggle.
  4. Add the paragraph to a content type.
  5. Edit content using:
  • Default Paragraphs widget → conditional fields work.
  • Layout Paragraphs widget → conditional fields do not work (the dependent field never shows/hides).

Proposed resolution

Based on investigation:

The issue seems to be that the Conditional Fields module is unable to correctly retrieve the parent paragraph entity when using the Layout Paragraphs widget.

To resolve this, a condition/check needs to be implemented for Layout Paragraphs specifically, so the parent entity can be retrieved successfully.

This approach would be similar to what was done/proposed for Layout Builder integration in another issue. https://www.drupal.org/project/conditional_fields/issues/3105263 Support for Layout Builder Needs work

🐛 Bug report
Status

Active

Version

4.0

Component

Compatibility w/ other modules

Created by

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

Comments & Activities

Production build 0.71.5 2024