Saltar navegación

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

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

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 -

Zona horaria del colaborador: Europe/London (GMT+01:00)

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Purchasing WCER 4 years, 7 months ago.

Asistido por: Nigel.

Autor
Mensajes
#2200925

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

#2201567

Nigel
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+01:00)

Where can I see the problem?

I visited enlace oculto 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: enlace oculto 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 enlace oculto 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: enlace oculto

#2201771

Nigel
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+01:00)

The correct View is actually enlace oculto

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!