Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty checkbox fields won't save #3844

Closed
jalendport opened this issue Feb 14, 2019 · 3 comments
Closed

Empty checkbox fields won't save #3844

jalendport opened this issue Feb 14, 2019 · 3 comments

Comments

@jalendport
Copy link
Contributor

Description

When you have a checkbox field on an entry and none of the option(s) are selected, saving the entry results in a Couldn’t save entry. error. The checkbox field is highlighted and says CheckboxField is invalid.

Looking in the logs I see:

2019-02-14 11:48:13 [-][1][-][info][craft\services\Elements::saveElement] Element not saved due to validation error: Array
(
    [testField[0].options[0].misc] => Array
        (
            [0] => CheckboxField is invalid.
        )

)

I just upgraded to the latest version of Craft CMS this morning so 99% sure this was introduced in one of the last couple releases (3.1.8 +).

Steps to reproduce

  1. Create a checkbox field and add it to a section
  2. Try to save entry without selecting any of the checkbox field(s)

Additional info

  • Craft version: Craft CMS 3.1.10
  • PHP version: PHP 7.1.25
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions: tested on a clean install with no plugins
@samhernandez
Copy link
Contributor

I've replicated the error on a fresh installation of Craft 3.1.10, PHP 7.2.10, PostgreSQL 11.1

@jalendport
Copy link
Contributor Author

Thanks @samhernandez and @brandonkelly 🙌

@brandonkelly
Copy link
Member

Just released 3.1.11 with a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants