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

Ligthtswitch default value "enabled" state is not respected #2404

Closed
acehead opened this issue Feb 6, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@acehead
Copy link

commented Feb 6, 2018

Description

When adding lightswitch to entry type with default value configured to enabled, the value of it when editing entry remains disabled

Steps to reproduce

  1. Create lightswitch field, default to on (enabled), translatable per site
  2. Add this field to entry type
  3. Edit an entry of this entry type
  4. Notice that default value is disabled, while it should be enabled

Additional info

  • Craft version: Craft Pro 3.0.0-RC6
  • PHP version: 7.1.12
  • Database driver & version: PostgreSQL 9.6.2
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Feb 6, 2018

This was technically the intended behavior (default value generally should only apply to brand new elements, not existing elements), but since Lightswitch fields are boolean, so null isn’t a relevant value for them in the first place, I guess an exception can be made. So just fixed this for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.