Skip to content

[5.x]: Fields renamed to the same label/handle on different entry types show incorrect conditional options for other fields on the same entryType #14787

@brionwolf

Description

@brionwolf

What happened?

Description

  • Renaming 2 separate fields on 2 separate entryTypes to the same Label and Handle will cause the conditionals menu to often reference the incorrect field or the first field made by that name.

Steps to reproduce

  1. Create two different fields with different options for use with conditionals (ie: 2 dropdown fields, one with options: red and blue, the second with options: green and orange)
  2. Add or edit 2 entry types with new or existing fields.
  3. Add one field from step 1 to the first entry type, and rename the field's label, and handle.
  4. Add the second field from step 1 to the second entry type, and rename it to the same label, and handle from step 3.
  5. Open the settings menu for a 3rd field, and attempt to add a conditional based on the state of one of the fields from step 1.

Expected behavior

  • The available rules for the field should relate to the fields on the entry type I am editing.

Actual behavior

  • The available rules possibly relate to a field of the same label/handle, but added to a different entry type.

Workaround

  • Use unique labels/handles for similar fields on different entry types.

Screenshot

animated gif of the craftcms admin screens attempting to apply conditionals on a field related to the attached bug

Craft CMS version

Craft Pro 5.0.3

PHP version

8.3.4

Operating system and version

MacOS Sonoma 14.4.1 (23E224)

Database type and version

MySQL 8.3.0

Image driver and version

GD 8.3.4

Installed plugins and versions

  • CKEditor 4.0.3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions