Passer la navigation

[Résolu] Date field storing blank space and breaking conditional logic

This support ticket is created Il y a 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 -

Fuseau horaire du supporter : Europe/London (GMT+01:00)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Purchasing WCER Il y a 4 years, 7 months.

Assisté par: Nigel.

Auteur
Publications
#2200925

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

#2201567

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01:00)

Where can I see the problem?

I visited lien caché 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: lien caché 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 lien caché 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: lien caché

#2201771

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01:00)

The correct View is actually lien caché

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!