Skip Navigation

[Resolved] Date field storing blank space and breaking conditional logic

This support ticket is created 3 years 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Purchasing WCER 3 years ago.

Assisted by: Nigel.

Author
Posts
#2200925

This entry: hidden link has a blank end date and the view hidden link has conditional logic to hide the end date if it is blank [wpv-conditional if="( $(end-date) ne '' ))"]–[types field="end-date" style='text' format='M j'][/types][/wpv-conditional]

This has been working in the past but it look like there is now a space or a value creating a space being added to the blank end date field so that when that event is published on the front end: hidden link it shows as Jan 25- , 2022

#2201567

Nigel
Supporter

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

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

Where can I see the problem?

I visited hidden link and I can't see where it shows the date as you describe.

I visited the post in the back end, where I see that the end date is blank, but can also see (in the Custom Fields metabox at the bottom of the page, which has the raw database values for the custom fields) that there is no content, no space character or similar, the field really is empty.

#2201705

The post referenced is currently saved as a draft: hidden link and that is why you don't see on the workshop page. If you temporarily publish that post you will see the issue on the hidden link page. Please move the post back to draft status after you are done.

The conditional logic that is only supposed to show the date dash is in this view: hidden link

#2201771

Nigel
Supporter

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

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

The correct View is actually hidden link

I checked with debug mode on and it was providing a value for the end date, even when the post didn't appear to have one.

I re-inserted the conditional shortcode (using the conditional output button) to check it was formatted correctly, and it applied the wpcf- prefix used by Types fields.

Saving the View and checking on the front end it appears to be working correctly.

I have reverted the event post status to draft.

#2201781

My issue is resolved now. Thank you!