Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Mark

ACF DatePicker field in Admin Column List

So I have a Last Updated field with ACF. I tried having that be one of the columns in the admin area. It shows only the first of 3 entries in the custom post type and fails on displaying the date and doesn’t display the next 2 posts in the list. Below is the error in the log file.

[16-Jul-2014 19:43:13] PHP Fatal error: Call to undefined method DateTime::createFromFormat() in /home/*/public_html/wp/wp-content/plugins/cac-addon-acf/classes/column/acf-field.php on line 287

7 years, 2 months ago
Jesper
Developer

Heya Mark!

Your PHP install appears to be lacking the DateTime module. We should be detecting whether this module is available, and certainly shouldn’t be having a raw PHP error being thrown like that!

We’ll certainly implement error checking for it, and we might implement fallback measures for users without the DateTime module. For now, however, your best bet is to contact your hosting provider and upgrade your PHP version to at least 5.2 (the time at which the DateTime module was implemented).

Cheers!
Jesper

7 years, 2 months ago
Mark

It is currently running PHP Version 5.2.17. And the field works fine when adding to the custom post type or editing an existing one. It is when displaying the column using Admin Columns Pro w/ ACF module installed that it stops when attempting to display that.

7 years, 2 months ago
Jesper
Developer

I misread your original post: the DateTime module is available, but the createFromFormat doesn’t exist. This isn’t suprising, as the createFromFormat method was only added to the DateTime class in PHP 5.3. The best fix for this problem at this point is to ask your hosting provider to upgrade your PHP version to at least 5.3; the rest of my answer still applies.

Cheers!
Jesper

7 years, 2 months ago
Mark

Guess I can’t use that column then currently as I can’t upgrade to 5.3 currently. Just doesn’t make sense why every place else the the field works fine except for when attempting to display in a column, or there isn’t a way around that? Is there a way to customize what gets displayed for a column when using admin columns using a filter?

7 years, 2 months ago
Jesper
Developer

The problem is that PHP, by default, doesn’t support all the formats added by Advanced Custom Fields. The DateTime module overcomes this issue, as it supports creating a formatted date from just about any date type. However, we’ll really look into adding support for this, or at least display an error message. At this point, however, there’s very little I can do, I’m afraid.

Jesper

7 years, 2 months ago
Akash

Hi Mate, I have got php 5.5 and still have the same issue

6 years, 3 months ago

You must be logged in to reply to this topic.