-
Notifications
You must be signed in to change notification settings - Fork 642
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
[4.x]: Switching Entry Type Appends Fields From Other Entry Types To Field Layout When Adding Content #11746
Comments
Are you getting any JavaScript errors on the page? |
No, no JavaScript errors are thrown. When simply interacting with the drop menu that holds the various entry types, the differing fields are appended to the bottom of the content entry form. |
Can you please send the following to [email protected]?
Also please point us to the section where you’re seeing this. |
The culprit here is that the two entry types in question had several field layout tab/element UUIDs in common. The whole point of field layout tabs/elements having UUIDs is so the element editor can know what’s currently visible, and what should be added/removed during autosaves, either due to field condition changes or switching the entry type. So it’s expected that the editor would get confused and become buggy if there are any duplicate UUIDs. The most likely cause is human error, e.g. if an entry type was duplicated from another, by copying its project config data, but without assigning unique UUIDs to the field layout components. We just added a new To get it early, change your php craft utils/fix-field-layout-uids |
Thanks for your help with this, it's much appreciated! |
Craft 4.2.2 is out now with that new command. |
What happened?
Description
We created a section as a channel with three (3) entry types. The entry types use most of the same fields in their respective layouts. When a new entry is created and defaults to the first entry type in the drop menu, when a selection is made for a different entry type (no content has been entered), the field layout is refreshed and appends any differing fields to the bottom of the content entry form.
Steps to reproduce
Expected behavior
When a selection is made using the entry type drop menu, the content entry form should reflect the field layout created for the applicable entry type.
Actual behavior
The difference in fields among any two entry types is being appended to the bottom of the content entry form. What's even more interesting is that if you perform these same steps on a draft entry, the page reload prompt appears asking if you are sure you want to leave the page, and upon confirming, the page reloads with the new entry type field layout.
Current Field Layout For Entry Types:
Example of Appended Field After Change In Entry Type
Craft CMS version
4.2.0.2
PHP version
8.0.8
Operating system and version
Darwin 21.6.0 (local development)
Database type and version
MySQL 5.7.34 (MAMP)
Image driver and version
GD 8.0.8
Installed plugins and versions
The text was updated successfully, but these errors were encountered: