I may have found a bug with new user blueprints in Kirby 2.2.x panel.
The issue occurs when using checkboxes on a user blueprint. I originally found the issue when using a checkboxes field with query fetching another page’s children. But I’ve replicated it with a fresh, clean install of plainkit. And the bug still shows up even with static options.
The issue:
It will not save an empty list.
- It saves properly if all items are checked
- It saves properly if at least one item is checked
- But it won’t save properly if all items are unchecked
PHP version: 5.6.15
Panel version: panel @ 53ebd4b
Kirby version: kirby @ b45f01b
To replicate:
// site/blueprints/users/admin.yml
fields:
checks:
label: Checks Test
type: checkboxes
# setting an empty default has no effect
# default:
# default: ""
options:
one: One
two: Two
three: Three
Then visit /panel/users/[you]
and check one, save. Then uncheck it, and save. You’ll see it’s still checked. Try multiple combinations, still occurs.
I’ll try to dig through the source and see if I can find the responsible code, will submit a PR if I can find it.