Skip to content

[5.x]: Fields with duplicate labels no selectable for entry conditions #15764

@Dollhopf

Description

@Dollhopf

What happened?

Description

When 2 (or more) fields have the same label (but different handle), only the first one can selected under Settings>Entry Condition>Add a rule. If a condition is selected with different labels and afterwards renamed to a duplicate label, the dropdown shows both correctly (see Expected behavior). Switching or deleting the condition results in the initial state with only one field showing (see Actual behavior).

Steps to reproduce

  1. Create a field layout with two fields of the same type and lable but different handle.
  2. Save entry to make the fields available vor Entry Conditions.
  3. Add a third field.
  4. Go to Settings>Entry Condition>Add a rule.

Expected behavior

Both fields should show independently, even if they have the same label.

Currently this is only true if the condition was set before renaming the field with the condition on it:
image

Actual behavior

The second field with the same label is missing in the selection dropdown.
image

Craft CMS version

5.4.4

PHP version

8.3

Operating system and version

Windows 11, Firefox 130.0

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

None

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions