Skip Navigation

[Resolved] Empty conditional not working

This thread is resolved. Here is a description of the problem and solution.

This support ticket is created 4 years, 10 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 16 replies, has 2 voices.

Last updated by tyeB 4 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1267633
Screen Shot 2019-06-13 at 6.01.57 pm.png

I am trying to: Check to see if the field has content

Link to a page where the issue can be seen: hidden link

I expected to see: The html below

Instead, I got: Nothing

[wpv-conditional if="( $( NOT(empty($(wpcf-accommodation-website))) )"]

<p><a href="[types field='accommodation-website' output='raw' item='$current_page'][/types]" class="button large" target="_blank">Book Now</a></p>

[/wpv-conditional]

This also outputs "Its Empty 15" when the value input is "15"

[wpv-conditional if="( empty($(wpcf-distance-to-town)) )"]Its Empty
[types field='distance-to-town' item='$current_page'][/types][/wpv-conditional]

hidden link

View Out

#1267715

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

First of all - After checking to debug information you shared with us, I found that you are using outdated Toolset plugins. We always recommend running your site with latest stable release plugin version.

Current Types version is 3.3.1 and Views version is 2.8.2.

*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/

Please update the plugins and let me know if the issue still persists.

#1268683

That is interesting - why are they not showing an update is required?

#1268685

Updated and the issue remains

#1268783

Can any Toolset support person see this or just you Minesh?

#1268785

Minesh
Supporter

Languages: English (English )

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

I'm checking the issue. What do you want to do let me know? Do you want to share things to other supporter?

#1268787

no, not if you have it under control - I was just concerned about the timeframe from my last post.

Your answer yesterday was when I was finishing work here and didn't want that to happen again.

#1268791

Minesh
Supporter

Languages: English (English )

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

Just wanted to ensure are you working on the site, I will be hopefully working on this issue in an hour.

#1268793

We have stopped all development until we heard back from you. I did supply a Duplicator archive too

#1268813

Minesh
Supporter

Languages: English (English )

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

I see you are talking about the following view:
=> hidden link

Can you please tell me where the above view is added with the problem URL you shared?

#1268815

It is in the Primary Sidebar on inner pages: hidden link

Is it just you and I who can see this thread?

#1268817

Sorry, so that would be found under Widgets

#1268837

Minesh
Supporter

Languages: English (English )

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

It looks like there is issue but I need to confirm on my local test install.

But for now, you should try to update the conditional statement as given under:

To check empty value:

[wpv-conditional if="( '[types field='distance-to-town' item='$current_page'][/types]' eq '' )" debug="true"]
            Its Empty [types field='distance-to-town' item='$current_page'][/types]
 [/wpv-conditional]

To check non-empty value:

[wpv-conditional if="( '[types field='distance-to-town' item='$current_page'][/types]' ne '' )" debug="true"]
            Its not Empty [types field='distance-to-town' item='$current_page'][/types]
 [/wpv-conditional]

More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/#special-cases

#1268845

That Works 🙂 I didn't think to try the Special cases.|

Thanks Minesh - what should I do - mark this as resolved or wait until you have done further testing?

#1268847

Minesh
Supporter

Languages: English (English )

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

Feel fee to resolve the ticket. 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.