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]: Unable to save new entry after switching entry type with renamed Asset field having the same name #16797

Open
croxton opened this issue Feb 28, 2025 · 3 comments
Assignees
Labels

Comments

@croxton
Copy link

croxton commented Feb 28, 2025

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"

@croxton croxton added the bug label Feb 28, 2025
@i-just
Copy link
Contributor

i-just commented Mar 3, 2025

Hi, thanks for getting in touch! I’m having trouble reproducing this. Any chance you could send your composer.json, composer.lock, and config/project directory to [email protected] so we can try to reproduce and dig deeper?

@croxton
Copy link
Author

croxton commented Mar 3, 2025

@i-just I've sent those over, let me know if you need any thing else!

@i-just
Copy link
Contributor

i-just commented Mar 3, 2025

Thanks for the files! I was able to reproduce it. I raised a PR for this.

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

2 participants