Skip Navigation

[Resolved] Different dateformats in relation parent and child datefield

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

Problem:

The issue here is that the user is sorting their view but not all their posts are showing.

Solution:

The problem was that not all of the posts that the user had the custom field filled out that was being used to sort the view.

If the post doesn't have that field with a value then it can't get sorted.

This support ticket is created 5 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by a.e.a.m.S 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1240386
Relation parent child datefield is showing in English format instead of Dutch format.png
child post date format field is okay it is in Dutch date format.png

I am trying to: filter on posts with a date field later than TODAY

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

I expected to see: the parent training post show up in the dropdownlist because it has unique training child posts with a date later than today.

Instead, I got: parent en child posts are not showing up in the list

Remark: All the "unieke trainingen" created on the 23th of february where imported with WP All Import, back then i encountered also dateformat issues during the import, i solved that with phpcode placed in the plugin "Codefragments"

All the "unieke trainingen" childposts created manually after the 23th of february 2019 won't show up in the filterpage mentioned above with a date in the datefield set to later than today...

#1240463

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

You have quite a number of posts being displayed. From what I can see the search is working fine.

However if you can link me to a specific post that is not showing up, I might be able to see what is wrong.

Thanks,
Shane

#1240506
Schermafbeelding 2019-05-07 om 17.50.57.png

Hi,

Filterpage: hidden link

An example of a parent training that shows up in the filter but not in the results for unique training;
Select the training below from the dropdownlist under "Opleiding" from the above filterpage
Keuren elektrische arbeidsmiddelen volgens NEN 3140

The unique training below does not show up, see attached screenshot
hidden link

#1240588

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Still not sure I understand correctly because based on the filter that was selected, this post should show up and the information is correct.

Is it that this parent should not show up in the filter? Because based on your filter settings it will.

Thanks,
Shane

#1240774

Hi Shane,

Indeed, it should show up but it does not.

The parent trainingen posts should ALL show up in the dropdown EXCEPT if they have no unique child training post attached to it OR the unique child training post has a datefield "datum training" that is equal or < than TODAY, to prevent clients from participating in a course that is already finished OR the training is fully booked, "vol-veld" = "VOL"

To make the result better visible, if you haven't done so yet, filter also on "Locatie" and select "Heerenveen" it will output 1 result with a unique training with a date 17-10-19 as shown in the screenshot from reply #1240506.

The unique child training: hidden link SHOULD pop-up ALSO but it does not.

#1241013

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I took a look at this again for you.

The issue here why it wasn't showing up was because the vol-veld field was empty. So if the field is empty this means that the field isn't added to the post meta table for this post. In theory the field wouldn't exist in the database.

What I would recommend that you do is to set a default value for this field so that once it is saved the field is created in the database.

As you can see blow the post now shows up.
hidden link

The only thing i did was added a value in the field that is not the same as "Vol" that your filter is checking for.

Thanks,
Shane

#1243525

Okay, i understand now, i didn't noticed it because the majority of the records where imported so all the custom fields of the records where put in the database even if they had no data in them, that is why the filter was working with those specific records.

I have placed a default value in the vol-veld so the filter will work now.
Thanks for looking in to it!