Uh oh!
There was an error while loading. Please reload this page.
Fix toggle field casting to boolean when field is hidden - #6348
Conversation
… value is submitted.
This reverts commit 9225d2a. All the values _would_ be submitted in reality, but the test wasn't submitting what would actually be happening.
aerni
commented
Jul 26, 2022
@jesseleite This issue still persists for me. I'm on the latest version. It might be due to nesting. My toggle field is in a Grid that's in a Grid that's in a Replicator. |
jesseleite
commented
Jul 26, 2022
@aerni I can't reproduce this with a toggle in a grid in a replicator. Could you provide more details what is happening for you, with steps to reproduce? In my test here... When the toggle is hidden, nothing is saved. If the toggle is visible, the proper value of the toggle gets saved. This is the expected behaviour, as described in description and docs link above. |
aerni
commented
Jul 26, 2022
I'll try to reproduce the issue on a fresh site and share the repo with you. |
aerni
commented
Jul 26, 2022
Alright. I was able to reproduce the issue.
Let me know if you need more info. |
jasonvarga
commented
Jul 26, 2022
Try taking out the |
aerni
commented
Jul 26, 2022
I actually need it to |
jesseleite
commented
Jul 27, 2022
@aerni I notice you are hiding the download toggle using a revealer. Any time a field is hidden via a revealer, data flow behaviour changes to always submit those hidden-by-revealer fields. |
aerni
commented
Jul 27, 2022
Yeah, I understand that. However, the download toggle has multiple conditions. One condition is triggered by the |
jesseleite
commented
Jul 27, 2022
@aerni Yeah I hear you now. This has nothing to do with toggle field specifically, or nesting within grids for that matter. This would happen on any field hidden by a revealer when multiple field conditions are set. Need to think about whether this might affect another use case negatively or not, but maybe I can improve revealer handling when multiple conditions are being evaluated 👍 Feel free to follow along here: #6385 |
aerni
commented
Jul 27, 2022
Ok, cool. Thanks for opening an issue 👍 |
jesseleite
commented
Jul 27, 2022
No problem, good find! |

Ensure the toggle fieldtype only casts to a saveable boolean when the value is submitted. When conditionally hidden, it should save neither
truenorfalse, according to our docs on conditional field data flow.Fixes#6347.