Skip Navigation

Checkbox and Checkboxes fields saving 0 will display Checked Custom Value even if not checked

Resolved

Reported for: Toolset Types 3.1.2

Resolved in: 3.2

Symptoms

When you use Checkboxes or Checkbox custom fields that store the 0 value when not selected and then use custom values to display for checked or unchecked state, the shortcodes will always display the checked state value.

For example, the following code will display “Selected”, no matter what you saved for the fields:

[types field='checkbox' state="checked"]Selected[/types][types field='checkbox' state="unchecked"]Not Selected[/types]

[types field='checkboxes' state="checked" option="0"]Selected[/types][types field='checkboxes' state="unchecked"]Selected[/types]

Workaround

This issue will be resolved in the future Types release 3.2

Until then, please apply the following workaround:

  • Download, unzip and upload the directory contained in this patch, to replace the one with the same name located in /application/models/, inside your Toolset Types installation.

One thought on Checkbox and Checkboxes fields saving 0 will display Checked Custom Value even if not checked

  • Thank you for this workaround! I was wondering why my much older filters were working with 0 and not my new ones.
    The patch works great. You will just have to resave all the posts to get the 0 into the database.

Comments are closed