Hello @berttervoert
Are you using the latest version of Pods?
This is a known issue that has been fixed since 2.7.17.
Related issue: https://github.com/pods-framework/pods/issues/5534
Cheers, Jory
Hello Jory,
I’m using the latest version of pods (v.2.7.22). Has the issue returned? What can I do to correct this?
Hi @berttervoert
What is the default value for this field? Empty?
Also, what kind of display type are you using?
Cheers, Jory
Hi jory,
the default value is indeed empty.
I havn’t gotten to the display part yet. As I wrote in the initial post, I’m talking bout the overview on the admin page which displays all the entries for this pod. I’ve added a screenshot: the column Lid sinds should be empty, but shows the date for today.
I’ve checked the database, and the value stored for this date field if left empty is 0000-00-00, which is correct. Why then does it show the current date on the admin overview page?
https://www.dropbox.com/s/t8txlzmpi72tj77/Screenshot_2020-10-22%20Clubleden%20%E2%80%B9%20De%20Door%28en%29trappers%20%E2%80%94%20WordPress.png?dl=0
Jory,
I think the problem isn’t coming from pods, but from wordpress itself or the plugin Admin Columns, so I’ll look there for a solution. Thank you for your reactions so far and I’ll mark this as resolved.
Hi @berttervoert
Thank you for the update. Could you let is know what caused the issue when you find it?
We also have contact with Admin Columns so if there is anything we can do to speed this up let me know!
Cheers! Jory
Hi Jory,
we’re trying to create a hook that lets me alter the value when the raw value is 0000-00-00. This was their explanation why the current date is displayed:
If you use the custom field column with type set to date it will try to parse a date with strtotime and format it according to the date format that has been applied in the column settings. Apparently, 0000-00-00 is parsed as the current date. While a 0000-00-00 format might not be ideal to have in the database, it is not invalid. I see two options to address this issue.
I’m still figuring out how to create the hook, since the given info is minimal (for me!), but we’re still corresponding about that.
final update:
It looks like I messed something up with the settings for date field. I deleted it and recreated it and now it works correct: it shows an empty field if the stored value is 0000-00-00 and the stored date if a date has been entered in the form.
Thanks again.
Bert
Hi @berttervoert
Ok thanks for the update!
If you use the custom field column with type set to date it will try to parse a date with strtotime and format it according to the date format that has been applied in the column settings.
Personally I think this should only be done if the passed value is not empty. At least, that is what Pods does.
Cheers, Jory