Saving unchecked checkboxes field

I have trouble, saving the Sidebarcheckboxes unchecked. It’s reverted to leaving one option checked,

any suggestions?

title: Seite
pages: true
files: true
fields:
  title:
    label: Menu Titel
    type:  text
  haupttitel:
    label: Haupttitel
    type:  text        
  untertitel:
    label: Untertitel
    type:  text  
  text:
    label: Text
    type:  textarea      
  bannergrafik:
    width: 1/2
    label: Bannergrafik
    type: checkbox
    text: aktivieren?     
  readmore:
    width: 1/2
    label: Freier Sidebar Text
    type: textarea
    text: aktivieren?  
  sidebar:
      width: 1
      label: Sidebar Elemente
      type: checkboxes
      default: false
      options:
        kontakt: Kontakt
        profil: Profil
        pressemitteilung: Pressemitteilung    

Try removing the default option entirely if you don’t need a default value.

Thanks for you answer!

Tried this before, doesnt work.

It seems to me, that the checkboxes field isnt saved at all when empty, its saved properly when at least one option is checked. I dont have any custom validation in place. When saving unchecked, after the page was saved this checked options, the page saves without error, but the boxes remain checked.

any further suggestions?

Have you updated to the lasted Kirby Version, i.e. 2.2.2? I think there used to be a problem with checkboxes that should be resolved now.

Yes, I have, but started the Project as 2.1.x

Actually this issue sounds like you are using a beta release of Kirby 2.2. Could you please check whether you are actually using Kirby 2.2.2, the latest stable release?

I cannot reproduced this behavior with an up-to-date kit, if no checkbox is checked, no value or key is saved, but no checkbox is checked in the panel either.

I can reproduce it: latest from download.kirby.com

just added

  sidebar:
    label: Sidebar Options
    type: checkboxes
    options:
      option1: Option1

to default blueprint.

edited about.txt via panel, same behaviour

indentation with spaces

Some general feedback: If you post code blocks, please use three backticks around your code so that the indentation and syntax highlighting are displayed.

Yes, you are right: I first tested with a 2.2.0 testkit, which worked alright. Then I switched to a 2.2.2 testkit, where I cannot deactivate a checkbox once it was checked. So I consider this a bug.

Sometimes (I cant recognize a pattern) There is some validation going on, but as I said, I havn’t set up any, haven’t even dig into validation still, but I like its presenation so far :wink:

anyways see screenshot attached, same blueprint as in first post

This was just fixed on the development branch and will be in the next release.

1 Like

I’m still seeing this issue in version 2.2.3. I can’t uncheck the last checkbox.

@lukehatfield as @texnixe wrote, this is fixed on the develop branch, not yet in a release, but will be included in the next release (2.3). You can find the develop branch on GitHub

Ah, that clears it up–releases are the second digit in the version number. Thanks @distantnative.

Not necessarily. Version 2.2.4 would be a new release too. :slight_smile: