Skip Navigation

[Escalated to 2nd Tier] Toolset conditional logic is not showing up properly

This support ticket is created 3 years, 1 month 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 7 replies, has 3 voices.

Last updated by Nigel 3 years ago.

Assisted by: Shane.

Author
Posts
#2216923

jum
Screenshot 2021-09-16 134110.jpg

I am trying to:
Update my Toolset with the latest plugin - I noticed before that when using the latest version, the conditional logic was messed up on my site. My account expired soon thereafter, I have not had the time to follow up on this. Now, when I just purchased the latest version, it is happening again. Knowing that I had this problem before, I have only uploaded the new plugin on my staging site.

Link to a page where the issue can be seen:
hidden link
Under the "latest funding opportunities", the "MSCA Postdoctoral Fellowships" shows "letter of intent due"

I expected to see:
The "letter of intent due" should not show because I have a conditional logic that only shows this field if there is a date in it.

Instead, I got:
"Letter of intent" is showing, without any dates.

#2216979

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

You can use this email to create the account for me. shane.c@onthegosystems.com

Thanks,

#2217053

jum

Hi Shane,
Thanks for the quick reply. I´ve just created an account for you and you should have received an email with your login. Please let me know when you need anything else from me.
Many thanks,
Judy

#2217663

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

It would appear that this issue is specific to your site only as i've created a fresh test site to check to see if I can replicate but i'm unable to.

What is happening is that the conditional is still picking up a value from the database even though the field is clear on the backend.

Here is the debug information of one example

####################
wpv-conditional attributes
####################
Array
(
    [if] =>   ( ( $(grant-first-closing-date) ne '' ) ) 
    [debug] => true
)

####################
Debug information
####################
--------------------
Original expression:   ( ( $(grant-first-closing-date) ne '' ) ) 
--------------------
--------------------
Converted expression: ( ( 1636555216 ne '' ) )

The example being shown here is for the MSCA Postdoctoral Fellowships 2022 post which has the field empty on the backend. However as you can see is that the converted expression is still picking up a timestamp for this field.

Displaying the field with the  [types field='grant-first-closing-date' output='raw'][/types] displays nothing which indicates to me that the field is empty. Its quite possible some field caching is involved but i've disabled the view cache and cleared the custom fields cache in Toolset -> Settings -> Frontend

As a workaround for this you can manually construct the conditional shortcode inside your Field and Text block. A manually constructed conditional would look like below.


[wpv-conditional if="('[types field='grant-first-closing-date' ][/types]' ne ' ')" ]

SOme content goes here

[/wpv-conditional]

This should be able to get it working again for you. When you check the page you will see that i've setup an example.

Please let me know if this helps.
Thanks,
Shane

#2217683

jum

Hi Shane,

Thanks so much for looking into this.

It is rather confusing to me because this problem only occurred in the latest version of Toolset, and not on 1.5.3 (currently on my live site). The manual workaround is somewhat impractical at this point for me because I have this type of conditional on all my views... The problem only happens when I create new posts where as old posts are not affected.

If you have another suggestion for me, that would be great. Otherwise I may have to return my latest purchase and wait for version 1.7?

Thanks again, best wishes,
J

#2217743

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jum,

What I can do is to escalate this issue so that our 2nd tier team can have a look and attempt to provide further clarity on this one for you.

Please leave the site as is so that they can have a look. I've provided them with the user login details as well. I'll provide an update once there is any information available.

Thanks,
Shane

#2217753

jum

Thanks so much Shane!
Best wishes,
J

#2249625

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Shane is on vacation. I wanted to let you know that this issue has been fixed in Types 3.4.15.

If you don't see an update notice on your plugins page, click the registered link for one of the Toolset plugins to take you to the custom Toolset installer page, and use the Check for Updates button, otherwise you can download the latest version from your downloads page at toolset.com/account/downloads.

If you confirm the fix, please go ahead and mark this thread as resolved.

Thank you.