craftcms / craftcms/cms

[5.0.0-alpha]: Conditionals don't work when applying in a matrix block

Open
#13,772 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

When conditionals are added to entry types used in a Matrix block, toggling a lightswitch for example doesn't get applied straight away.

Steps to reproduce
  1. Add a conditional (lightswitch) to an entry type to hide/show a field
  2. Add that entry type to the Matrix
  3. When going into the entry and toggling the lightswitch, the value gets saved but no action happens on the field with the assigned conditional.
  4. Click on entries to get out of the Editor
  5. Click on the entry again to go into the Editor
  6. The conditional has been applied.
Expected behavior

When switching around a lightswitch it should reflect the conditional straight away.

Craft CMS version

5.0.0-alpha

PHP version

8.2

Operating system and version

No response

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are mentioned. Reproduce the issue in the Craft CMS Matrix editor using a lightswitch conditional, then trace the conditional update handling when the entry type is nested in a Matrix block. Done means the dependent field responds immediately when the lightswitch changes, without leaving and reopening the entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.