Skip to content

[5.x]: Conditional field layouts fail with "Invalid element UUID" in element slideouts #19084

@jonaashl

Description

@jonaashl

What happened?

Description

When opening a related entry in an element slideout, if that entry's field layout contains conditional visibility rules (e.g., a lightswitch controlling whether other fields are shown), the update-field-layout action fails with "Invalid element UUID". The error occurs immediately when the slideout renders and when interacting with the lightswitch.

The same conditional layout works correctly when the entry is opened in full-page edit view.

In my case, the related entry is on a different site.

Steps to reproduce

  1. Have an entry type with an entries field that can select entries from a different site.
  2. The related entry type should contain a Matrix field.
  3. Inside that Matrix, have an entry type with a lightswitch field and conditional layout rules (e.g., fields visible only when lightswitch is on).
  4. Open the entry with a selected related entry in the relation/entry field.
  5. Click the related entry chip to open it in slideout.
  6. Try flipping the lightswitch to show the conditional fields.

Expected behavior

The slideout should show / hide fields based on the current lightswitch state, and respond to changes.

Actual behavior

Immediately on slideout load, the following error is returned:

400: POST actions/elements/update-field-layout&site=default {"name":"Bad Request","message":"Invalid element UUID: <uuid>","code":0,"status":400}

Toggling the lightswitch fires the same error again. Fields do not show/hide.

After toggling the lightswitch, closing and re-opening the slideout makes the fields visible / hidden.

Craft CMS version

Craft Pro 5.10.2

PHP version

8.3.30

Operating system and version

Linux 6.1.170

Database type and version

MySQL 8.0.42

Image driver and version

Imagick 3.8.1 (ImageMagick 6.9.11-60)

Installed plugins and versions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions