Skip Navigation

[Resolved] Condition Processing Relating to Checkbox Values Being Processed Incorrectly

This support ticket is created 6 years, 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Minesh 6 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1110759

I am trying to:

I have a Layout relating to some custom fields. One of the custom fields is a checkbox, which has 4 possible values. I have some conditional logic in the Layout relating to the checkbox. When one or more checkbox values are selected, these values will be displayed on the front-end page. When no values are selected, then 'Not Applicable' text will be displayed on the front-end. The condition logic is here (the checkbox custom fields is called "honours"):

[wpv-conditional if="( '[types field='honours' separator=''][/types]' ne '' )"]Honours: [types field='honours' output='text'][/types][/wpv-conditional][wpv-conditional if="( '[types field='honours' separator=''][/types]' eq '' )"]Honours: Not Applicable[/wpv-conditional]

Link to a page where the issue can be seen:

hidden link

Under the 'Personal Information' sub-section on this page, you'll see the Honours values. Since the latest software update, the front-end is now displaying all four possible values on every profile page, instead of the relevant honour value (or a 'Not Applicable' message, if no honour values were selected in the back-end)..

I expected to see:

hidden link

On the above page, only one of the Honour values should've been displayed: 'OBE'.

Instead, I got:

All four honour values are being output.

As far as I can recall, this conditional logic worked properly last night. I installed the latest version of Layouts today and now the conditional logic is not being processed correctly.

#1111310

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please share access details so I can check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1111577

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - first of all, there is not attribute available like output="text" , As I can see with shortcode you shared.

Honours: [types field='honours' output='text']

=> https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes

What if you try to use following code:

[wpv-conditional if="( '[types field='honours' separator=''][/types]' ne '' )"]

Honours: [types field='honours' state="checked" option="0"]  adjust your value here [/types],
         [types field='honours' state="checked" option="1"] adjust your value here  [/types],
         [types field='honours' state="checked" option="2"]  adjust your value here  [/types],
         [types field='honours' state="checked" option="3"]  adjust your value here  [/types]

[/wpv-conditional]
[wpv-conditional if="( '[types field='honours' separator=''][/types]' eq '' )"]Honours: Not Applicable[/wpv-conditional]

Where:
- you can add/remoe the number of option shortcode