Closed qroft closed 2 years ago
Thank you @bennothommo for clearifying this. I am a dev-noob and often do not know how to make these entries right. Nevertheless i do have question about this: Can you put in here the structure on how the "Checkbox List" data is saved inside the MySql DB? I am asking, so that i can put my data in the table manually how the widget would love to see it until the bug is eleminated. Thanks in advance!
@qroft to fix the issue for yourself manually, simply add the attribute you're using for the checkboxlist field to the $jsonable
property on your model, see https://wintercms.com/docs/database/model#property-jsonable for more information.
@LukeTowers we probably should add to the docs any fields that might need to be stored as $jsonable
(like the checkbox list, or repeater). Currently, I believe, we only make this clear for the data table widget. Perhaps we can also indicate that these fields should be stored as a TEXT type or a JSON type in the DB.
Winter CMS Build
1.1
PHP Version
7.4
Database engine
MySQL/MariaDB
Plugins installed
Winter.Builder,Rainlab.User
Issue description
Within the builder plugin i have created a DB with a column called "settingsO" as "Text" with a length of 65535. Then in my models for this DB, i went to Forms -> fields.yaml and created a "Checkbox List" with three options.
It does not matter if i choose one, two or all options from within my form in the backend, i always get this error: "Unexpected type of array when attempting to save attribute "settingsO", try adding it to the $jsonable property." on line 781 of /htdocs/vendor/winter/storm/src/Database/Model.php
Steps to replicate
Workaround
No response