Skip Navigation

[Resolved] Post related checkbox "Not selected value" not displaying.

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by Beda 6 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#911131
5) view.png
4) view - setting.png
3) included service.png
2) relationship.png
1) show one of these.png

Hello, this: https://toolset.com/errata/checkboxes-set-to-save-0-if-empty-do-not-save-anything-if-they-are-updated-through-a-parent-post-and-not-checked/ is definitely not resolved.

It stopped working completely now. I can see only the checkbox selected value.

So here is the problem:

1) I have custom field groups with checkboxes. Checkboxes are set up as you can see on screenshot number 1
2) I have a relationship between "Product" post type and Custom post type "Included Services" (screenshot 2)
3) I create a new post in "Included services" and associate it to the "product" and select the checkboxes. I only select the ones the product has included. (screenshot 3)
4) Then on a product is view, which should display all checkboxes, because of their setting in 1st point and CSS style adds a Red or green checkmark to it. (screenshot 4 and 5)
5) It shows only the Selected checkboxes value. Not the Non selected value. (screenshot 6)

Please help me. Why it doesnt show the Non selected value? Is it broken after relationship update of toolset?

THANKS.

#911372

We have some issues with Checkboxes in those scenarios.

A) Checkboxes assigned to a Post Type which is used in a Many To Many Legacy (Created with old Types) Relationship, are not editable on versions 2.3, 2.3.1 and 3.0(not migrated).

This means, step by step:
1. Install Toolset 2.3, or 2.3.1
2. Create a M2M relationship with an IPO (Legacy relationship)
(Students, Classes, Student-Classes)
3. Create a Custom Checkboxes Field with a few options and assign this Field group to the Students post type
4. Create a few students, classes, and then connect a few of those with an IPO
5. Once done, try to edit the Checkboxes Field in a student post, and save it.
==> It will always save nothing (nothing checked)

==> You can update to 3.0 and the issue persist
==> If you MIGRATE then the issue is gone

B) When you edit the Fields of a related post thru the Quick Edit GUI of related posts, and try to save those fields as "unchecked, unset, not selected", then it will instead save them as checked.

Step by Step:
1. Create new M2M Relationship between 2 Post Types of your choice, and add a Checkbox Field and a Checkboxes Field (all with options) to the IPO
2. After completing the wizard with default settings (I chose to show the intermediate post in the menu), create a new post in one end of the relationship
3. After saving the post start adding new related posts, and set all the possible options of your fields as checked/set
4. Save everything and now quick edit the related posts, and set all the possible options of your fields as unchecked/not set

After saving, you will see that still all options of those fields are still checked

C) Some users use/d to save entire HTML links or other markup as Field Values.
This mostly worked with Toolset Legacy (pre-3.0)
Toolset 3.0 introduced an issue where those values are now escaped in the HTML on the front end.

Step by Step (this is a long one)

Start with Toolset Legacy.
1. Create a Field of each type as listed:
Select
Radio
Checkboxes
Checkbox (2 of them)
Single Line
3. Populate each of those fields (where possible) with values for their options. Use this dummy values:

<a href="<em><u>hidden link</u></em>">Text with characters like #ç$£&% etc.</a> 

, or

<a href="/labels/concord-jazz/"> <img src="/wp-content/uploads/2017/12/Concord-Jazz-600.png" width="100"> </a>

, or even simply

 <" something "> 

4. Head to any post and save for each field that option, for the single line, just save the same value as well.
5. Insert each field to the Post Body with the Types ShortCodes, using raw output:
Radio: [types field='radio' output='raw'][/types]
Select: [types field='select-field' output='raw'][/types]
Checkbox: [types field='checkbox' output='raw'][/types]
Checkbox No problem: [types field='no-problem-box' output='raw'][/types]
Checkboxes: [types field='checkboxes' output='raw'][/types]
Single: [types field='single' output='raw'][/types]
Note that unless the Checkbox and Checkboxes field, all fields saved their value, and display it fine on the front end

6. Update to Toolset 3.0

Note that now it seems we escape the " with \ in the HTML source.

Note that I did not see any other problematic characters but the double and single apostrophe, but there may be more, and for example, the < > values are completely stripped in 3.0, not shown anymore, while they show on Types Legacy (front end).

Now, I am pretty sure all 3 issues apply to your install, especially the last one, since those options hold those stripped characters.

But, the issue you report is once more another.

I replicated it with these steps:
1. Create a Checkboxes Field, add 2 Options
2. To the First option, add the "Show one of these two values:" (Not selected:, Selected:). I used simple strings:
Selected/Not selected
3. Add a Post and save both options of the checkboxes field as checked, insert the ShortCode for this field as natively suggested by the GUI:
[types field='toolset-checkboxes' separator=', '][/types]
4. See the front end, it'll display your custom selected value
5. Uncheck the first option of this Checkboxes Field (the one you have custom values for selected/not selected) and see that the front end does NOT display our not-selected text.

This seems once more a new bug, it's not entirely related to the old closed one, but as well not to the new bugs listed above.

I reported it and our developers will work on this ASAP.

I found no valid workaround for the issue.

#921636

This is what we will do about this issue:
- Eventually, we add in future an extra value for the output attribute that returns the options labels instead of their raw values on purpose.
- There are plans for a wide refactoring of the checkboxes field in the near future, and that is why the developers cannot address this right now immediately.
- The new version of this field should work as expected out of the box.

This ticket can be closed, unless yo wish me to update you once this is implemented, here in the ticket.