area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.63k stars 560 forks source link

Use strict check for is null, as it otherwise causes empty arrays to not have any field #2604

Closed Tofandel closed 1 month ago

Tofandel commented 1 month ago

Because null == [] is true in php, fields which are empty arrays (for example for Checkboxes) were not present in the TWILL.store.form.fields

This causes issues with connectedFields which expect the field to always be an array if arrayContains is set to false and so the field does not appear when it's expected to when loading the page (until you check and uncheck a checkbox)