Skip to content

[5.x]: Unable to save new entry after switching entry type with renamed Asset field having the same name #16797

@croxton

Description

@croxton

What happened?

Description

I have a section with two entry types, 'Feature video' and 'Background video'. Both entry types contain an Asset field videoLandscapeMp4 and in both cases it is a renamed field with the original handle being videoAsset. If I create a new entry using the default entry type (Feature video) everything works as expected. After saving I can also subsequently switch to the 'Background video', and everything works fine. However, when creating a new entry if I immediately switch to the entry type 'Background video' and populate the videoLandscapeMp4 field the value is lost when I try to save.

Entry.type.error.mov

Steps to reproduce

  1. Create a section with two entry types, add the same Asset field to it and in both entry types rename the field to the same handle, and make required.
  2. Create a new entry and select the second entry type.
  3. Populate fields and save.

Craft CMS version

5.6.10.2

PHP version

8.3.17

Operating system and version

DDEV

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

"craftcms/ckeditor": "^4.4.0",
"craftcms/cms": "^5.6.10.2",
"craftcms/postmark": "^3.1.0",
"craftpulse/craft-colour-swatches": "^5.1.0",
"croxton/imgixer": "^3.0.1",
"jalendport/craft-preparse": "^3.0.0-alpha.2",
"nystudio107/craft-seomatic": "^5.1.11",
"nystudio107/craft-vite": "^5.0.1",
"putyourlightson/craft-sprig": "^3.5.2",
"servd/craft-asset-storage": "^4.0.15",
"solspace/craft-freeform": "^5.9.15",
"verbb/hyper": "^2.2.3",
"verbb/image-resizer": "^4.0.2",
"viget/craft-classnames": "^3.0.0",
"vlucas/phpdotenv": "^5.4.0"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions