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.
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
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.
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?
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.
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.