I am trying to:
We've used Types and Views to create a content template that displays a set of characteristics for the Unit Listing custom post type. We've defined several fields as checkboxes (Study, Media room, Rooftop terrace, Elevator, Gated community). When the box is checked, the content template should display "Study" (etc.), but when it's unchecked, it should display "no-study" wrapped in a span tag with the class "no-study," which renders it invisible. It has worked correctly in the past, but for some reason, all of unit listings are now displaying all of these characteristics, even when they're unchecked.
Link to a page where the issue can be seen:
hidden link
I expected to see:
On this particular unit listing, Study, Media room, Rooftop terrace, Elevator included, and Gated community are all unchecked, so none of those characteristics should be displayed.
Instead, I got:
All of the unchecked characteristics are displayed.
At the client's request, I have temporarily hidden the problematic section of the unit listings by wrapping it in a span of the class "optional-details," but you can still view the problem area in the source code for purposes of troubleshooting.
I think it is the same issue as reported to us here:
https://toolset.com/forums/topic/multiple-checkboxes-values-always-showed/
To confirm if this is the same BUG, I will below outline the symptoms and other details.
1. Create a Checkboxes field, several options, save 0 to the database if unchecked
2. Populate a post and check one of the options, save
3. Insert the ShortCode to display that field with Custom Values for checked and unchecked options like so:
[types field='checkboxes' state="checked" option="0"]s[/types]
[types field='checkboxes' state="unchecked" option="0"]n[/types]
[types field='checkboxes' state="checked" option="1"]s[/types]
[types field='checkboxes' state="unchecked" option="1"]n[/types]
[types field='checkboxes' state="checked" option="2"]s[/types]
[types field='checkboxes' state="unchecked" option="2"]n[/types]
etc
When you visit the post, you will see the Custom values for "checked" being output for all options, even if only one was checked
Expected is to see one Custom Value for checked and n for not checked.
This was broken with the 3.1 updates, before that, it works
Our developer has already proposed a fix, which is in code review.
A fast solution can be not to save 0 for those unchecked options.
To update existing fields, you might consider running a custom code:
https://toolset.com/errata/checkboxes-that-save-0-are-interpreted-as-checked-by-views/
I was not able to confirm this myself on your site as the Password provided was wrong, could you check and eventually add a new one, in case we need to take a look?