[4.x]: Craft deletes content of already filled fields
What happened?
Description
If you create a new Entry or edit an existing one and miss several required fields , Craft will delete already filled required fields after on save.
I'd be really really happy to have a reliable behavior again. We currently have a client that has a lot of problems in the backend with scrambled NEO blocks on save, Mutex locks, etc. – and currently we have 2 sites on hold because saving in the backend will cause content to be broken. The current state of content editing is not stable.
Steps to reproduce
- Create a new entry which contains more than one required field
- Leave all required fields empty
- Save
- It will show the errors
- Fill one required field
- Save
- Error will be gone on the field
- Fill the next required field
- Save
- Text from the last required field will be gone
Additional
- If you empty a field afterwards and edit another field and save, it will get its original value back.
- With a "Typed Link Field (Plugin)" in the mix in a Matrix, validation completely fails
Expected behavior
Fields that are filled should always keep their actual value. If I empty a field, it should stay empty and throw an error. If I edit a field, it should not affect other fields.
Actual behavior
Fields can lose their value. This seems to happen at random. Sometimes it will remove an already existing value, sometimes not. It seems to help to wait for the autosave to finish.
Craft CMS version
4.2.0.2 & 4.2.1
PHP version
8.0.19
Operating system and version
MacOS Monterey 12.5
Database type and version
MySQL (mariadb 10.5.13)
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-35)
Installed plugins and versions
No response
Happens with and without autosaveDrafts enabled.
https://user-images.githubusercontent.com/910594/183871838-86aae14a-6ba8-4ce1-9d08-0bc63f411c71.mov
Thanks, this turned out to be the same underlying issue as the field value-forgetting bug you reported in #11731. I just didn’t look deep enough when looking into that.
Just released 4.2.1.1 with a proper fix for both.
Thank you for the quick fix and release.