Bug #22973 Duplicate

Toggle Field Default state always “off” in grid field

Version: 3.5.2 Reporter: MajesticIX

I’ve setup a toggle field within a grid field and set the default position to “on”. When adding a grid row, the toggle field is always in the off position.

  • Bah, I see it’s a duplicate bug report. My bad.

    MajesticIX
    20th February, 2017 at 4:35pm
  • Indeed duplicate of #22967 Issues with toggle fields in grids. smile

    See the solution tab for an immediate fix.

    Derek Jones
    20th February, 2017 at 4:41pm
  • Thanks–I commented on that post as the solution seems to ignore my selection:

    I attempted to use the solution provided–It now is always set to “on”–even when I select the “off” state and save. I reverted back to the old code and it correctly saves my selection, it just always starts off inactive.

    MajesticIX
    20th February, 2017 at 4:50pm
  • Good catch, MajesticIX, I’ve updated the solution in the original bug report to address PHP’s loose datatype issues.

    Derek Jones
    20th February, 2017 at 5:01pm
  • Back in business, nice work!

    MajesticIX
    20th February, 2017 at 5:03pm

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases