Navigation überspringen

[Gelöst] Date field storing blank space and breaking conditional logic

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

Zeitzone des Unterstützers: Europe/London (GMT+01:00)

Dieses Thema enthält 4 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Purchasing WCER vor 4 years, 7 months.

Assistiert von: Nigel.

Author
Artikel
#2200925

This entry: versteckter Link has a blank end date and the view versteckter 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: versteckter Link it shows as Jan 25- , 2022

#2201567

Nigel
Unterstützer

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+01:00)

Where can I see the problem?

I visited versteckter 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: versteckter 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 versteckter 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: versteckter Link

#2201771

Nigel
Unterstützer

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+01:00)

The correct View is actually versteckter 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!