Skip Navigation

[Resolved] Importing toolset date fields via WP All Import

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 3 voices.

Last updated by Nigel 1 year, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2689053

Tell us what you are trying to do?
Import all of the toolset custom fields via WP All import, when importing the date fields as UNIX timestamps they do not get inserted in the Data fields of the posts that I want to update.

Is there a similar example that we can see?
https://toolset.com/forums/topic/wp-all-import-date-format-for-date-field/

Is there any way I can have it imported with WP ALL Import

#2689123

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you may already informed that Types date fields stores the value of date as Unix Timestamps. Having said that you will have to convert the date string to equivalent Unix Timestamp before you import the csv file.

Can you please try to convert your date column string value to Unix Timestamp for your CSV file and then try to import it and check if that works for you.

#2689137
Bildschirmfoto 2024-03-22 um 09.22.45.png
Bildschirmfoto 2024-03-22 um 09.20.41.png
Bildschirmfoto 2024-03-22 um 09.17.02.png

Hi Minesh,

we are not importing csv Data. We import XML.

The data we are importing IS ALREADY a Unix Timestamp. See the field <wpcf-erstausstrahlung> in the image attached.

We are importing into a toolset Date Field. See the other image. When we open the imported Posts the Datefield "Erstausstrahlung" shows nothing.

Some advice how to fix this would be highly appreciated. Thanks in advance.

#2689156

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is strange.

Can you please share what XML file you are trying to use as well as if you can share staging site with admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2689477

any update on this?

#2689478

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

Minesh is off today, so let me step in.

I ran a quick test on my own local site to see if Types date fields imported correctly, and it didn't work correctly (it *did* import a value, but the value stored in wp_postmeta was not the same as the value in the import file).

We need to investigate this further to see if we can spot what the problem is, so I'm escalating this, and we'll get back to you once we've had a chance to investigate more fully.

Note, the Types add-on for WP All Import Pro is created and maintained by WP All Import.

#2689490

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

The problem occurs because the Types add-on of the import plugin converts dates from the import file into timestamps for Types date fields, without first checking if it is already a timestamp.

As mentioned previously, the add-on is managed by the WP All Import team, and so you may want to contact their support to request a fix.

In the meantime you can make the following change to their plugin to avoid the problem.

Update the file wp-content/plugins/wpai-toolset-types-addon/src/fields/fields/FieldDate.php and change the definition of the getFormattedValue function (line 70) like so:

    protected function getFormattedValue($date){
        if ( !is_numeric($date) ) {
            $date = strtotime(trim($date));
        }
        return $date;
    }