Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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

Closed
brionwolf opened this issue Apr 10, 2024 · 3 comments
Assignees
Labels

Comments

@brionwolf
Copy link

brionwolf commented Apr 10, 2024

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
@brionwolf brionwolf added the bug label Apr 10, 2024
@i-just i-just self-assigned this Apr 11, 2024
@i-just i-just assigned brandonkelly and unassigned i-just Apr 23, 2024
@brandonkelly
Copy link
Member

Just got this fixed for Craft 5.1. Going forward, element conditions will only include custom fields present in the current field layout, so there won’t be any ambiguity over which “Featured Type” field you should be selecting.

The available custom fields will always reflect the currently-selected fields in the layout—even newly-selected fields which haven’t been saved to it yet.

@brandonkelly
Copy link
Member

Craft 5.1 is out with those changes.

@brionwolf
Copy link
Author

Thanks @i-just @brandonkelly !! This update is a game changer for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants