There seems to be a bug where a conditional in a View content template will not work correctly if the conditional is evaluating whether a user field of type URL is empty or not.
I am trying to: Add fields to the users for various social media, and display an icon on the front end only if the field is not empty.
I expected to see: The icon show or hide based on whether or not the condition evaluates to true or false i.e. a URL was in the URL field (e.g. hidden link).
Instead, I got: No icon or link shows whether the condition evaluates to true or false. I changed the field type from URL to Single Line and the conditional logic works as expected.
Hello. Thank you for contacting the Toolset support.
First of all - After checking to debug the information you shared with us, I found that you are using outdated Toolset plugins. We always recommend running your site with the latest stable release plugin version.
*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
Once you update ALL Toolset plugins to official latest stable release version. Can you please check if you still having the same issue? if yes:
- I would like to review how you added conditional statement to your site.
Can you please share problem URL and access details.
*** 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 have set the next reply to private which means only you and I have access to it.
I submitted this as a bug report. If this isn't a bug, I'd like to re-submit it as a support request so that it will be archived in the forum. Let me know how I should do that. Thank you!
This isn't about the output. It's about the conditional evaluating whether or not the field is empty.
Outputting the field value (as a link or as txt) was never a problem, but having the conditional evaluate whether or not the field even has a value simply doesn't work on user meta URL fields without adding "output='raw'" to the field being evaluated in the conditional.
That is not how it works on post fields. On post fields, a URL field can be evaluated in a conditional as-is.
Hello, as Minesh is on vacation, I'll continue with you on this ticket. I hope that's fine.
From what I understand so far, you expect a condition evaluation on a URL user field to match without using the "raw" parameter, right?
Or, if I understood well, you expect the following shortcode to return an empty string if the field is empty, right?
[types usermeta='twitter'][/types]
To be able to escalate this issue to our 2nd Tier for another analysis before being handled by a developer, we'll need to reproduce it on a clean installation on our platform, for that reason, I created a new WordPress site and I hope you will help reproduce the issue on it. You can log into it with the following URL hidden link
Once the issue is reproduced, I'll escalate it to our 2nd Tier and I'll keep you updated on its progress.
Thank you for the sandbox site. That's very helpful. I've created a demo that shows the issue: hidden link
This demo consists of custom user fields, a View to loop through the users (only one user in the demo) and display those fields only if they have values entered, and a custom post field added for comparison.