Closed Mixxey closed 1 year ago
Hi, thanks for reaching out. Any chance you could please send your composer.json
, composer.lock
and database export from before the update to support@craftcms.com and point to a few entries that are affected by this issue?
Hi Iwona, thanks for getting back to me! I just sent an email with the provided info via WeTransfer (to have room for the database export). I hope this worked and helps :)
Hi Tina, thanks for the files!
Replication steps:
This will happen in the 4.5+ versions (you don’t have to go through the update process to replicate it).
This is a side effect of the field value being NULL
in the database (because the field was added to the entry type, but the entry hasn’t been saved since) and an empty string (''
) option available in the checkbox field (in this case, if the checkbox is not selected, the value for this field is stored in the DB as an empty array []
; if the checkbox is selected, the value for this field is stored in the DB as an array with an empty string in it [""]
).
I’m working on a PR to adjust this behaviour.
Hi Iwona, thanks a lot, this is really interesting! I'm lookin forward to hearing from you again. Thank you for the very quick and good support! :)
This is now fixed for the next release, via #13727 🎉
Craft 4.5.6 is out now with that fix.
Great! Thanks so much :)
What happened?
Description
After updating from Craft 4.4.17 to 4.5.5 several checkboxes used to control styling options and sometimes other functions are checked across several entries which were not checked before the update and are not meant to be checked in their specific contexts.
This happens independent of the entry and field types they are attached to. I found the checked checkboxes in constructions as complex as "a matrix field inside of a neo block inside of a neo block" but also in checkboxes on entry-level so it doesn't seem to have something to do with neo blocks or the overall complexity.
I also noticed that all affected checkbox-type fields didn't have the "Die Feldwerte als Suchschlüsselwörter verwenden"-checkbox checked (the one just above the dropdown where you set the field type), but checking those before the update didn't prevent the error.
Sadly, I wasn't able to find out more on my own, but maybe you can help? Many thanks in advance for looking into this mystery :)
Steps to reproduce
Expected behavior
No additional checkboxes should be checked that aren't meant to be checked.
Actual behavior
Checkboxes are checked without any too obvious pattern: Sometimes all occurrences within an entry are affected, sometimes only specific ones; some entries don't seem to be affected at all.
Craft CMS version
Craft Pro 4.5.5
PHP version
8.0.30
Operating system and version
Linux 6.2.0-32-generic
Database type and version
MySQL 5.7.43
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.10-23)
Installed plugins and versions