Closed technikone closed 2 years ago
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 support@craftcms.com?
composer.json
and composer.lock
filesconfig/project/
folderAlso 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 craft utils/fix-field-layout-uids
command for the next release, which can be used to quickly resolve this.
To get it early, change your craftcms/cms
constraint in composer.json to dev-develop as 4.2.1.1
and then run composer update
. Then run the following command:
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