Skip Navigation

[Resolved] strange behavior after importing childred CTP

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

Problem: After importing custom posts using a CSV importer, I am seeing Server Error 500 in the wp-admin when I attempt to edit one of my CPT posts. Additionally, the error log indicates:

PHP Fatal error:  Maximum execution time of 30 seconds exceeded ... /wp-content/plugins/types/library/toolset/toolset-common/lib/adodb-time.inc.php on line 656

Solution: Review the CSV file contents before importing. Ensure all dates are encoded as proper Unix timestamps.

Relevant Documentation: https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/

This support ticket is created 7 years, 2 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by JeremyN9794 7 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#489184

Hi

I've created 2 CTP : Organisme and Activités.
One organism can have many Activités.
So, in my CTP, I setted that the children of the Organisme are the Activités.

I imported all my Organismes using CSV importer as you adviced it me a few month ago : and it's ok for this.
But now, I'm trying to import the Activites file in which I set a column '_wpcf_belongs_organisme_id' to do a match with the parent already present in the database.
It's a little bit strange, because, when I'm trying to edit a CTP Activites using the wordpress admin page, it's turning arround, and finally giving me a http 500 error.
But when I go to the permalink to view this activité, it's ok.
Now, it's a problem, because I can't edit the activités after importing them.

Do you have an idea about it?

Regards,

#489222

That's unusual, I'll be happy to help get this working correctly. I would like to see more information about the 500 server errors. You can see how to enable debug logging here:
https://toolset.com/documentation/user-guides/debugging-toolset/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Edit your wp-config.php file and add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Then, try to edit one of your Activités. This should create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the updates you made to wp-config.php.

If possible, please also paste the contents of the CSV file you were using to upload the Activités.

#490230

Hi Christian

thanks for your answer.
Here is the content of the error_log.txt after try to edit a concerned "activite" :

[16-Feb-2017 21:46:03 UTC] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/www.inforjeunesmons.be/wp-content/plugins/types/library/toolset/toolset-common/lib/adodb-time.inc.php on line 656

And here is the content of the sample CSV file I've imported (without any errors while importing).

"csv_post_title","csv_post_post","csv_post_excerpt","wpcf-act-code-organisme","wpcf-type-d-activite","wpcf-categorie-d-activite","wpcf-acces-aux-personnes-a-mobilites-reduites","wpcf-type-de-handicap","wpcf-place","wpcf-adresse-activite","wpcf-pays","wpcf-code-postal","wpcf-ville","wpcf-telephone","wpcf-fax","wpcf-description-de-l-activite","wpcf-site-web","wpcf-contacts","wpcf-age-minimum","wpcf-age-maximum","wpcf-date-de-debut-activite","wpcf-date-de-fin-activite","wpcf-type-de-logement","csv_post_type","_wpcf_belongs_organisme_id"
"VILLE DE MONS"," bl"," ","2146145008","1","73302","0","","Auditorium Abel Dubois","Esplanade Anne-Charlotte de Lorraine","","7000","MONS","","","Atelier Théâtre Performatif et Sonore du Collectif québécois L'eau du bain.Lien pour l'inscription : <em><u>hidden link</u></em>","","","15","18","20150406000000000","20150410000000000","0","activite","2499"

Regards

#490591

Thanks. Can you tell me what dates these fields should represent?

20150406000000000
20150410000000000

#490608

Hi,

these dates represent dates for the beginnig and the end of the activity I'm trying to import?
And ok, you found the problem....
I deleted the last 0 directly in the database, and, so I could open it the admin wordpress page.
But, it stores the dates in a special way.
For example, I'm trying to import the date '20150406' (6th april 2015), but it stores the date as '1487203200'.
Should I create a script to serialize the date?

Regards

Jérémy

#490610

I don't think you need to serialize anything. You should create a Unix timestamp for each date. Please refer to this document:
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/

There's a section called "Importing date fields" that mentions timestamps and links to some documentation. You can manually generate timestamps for each date using something like epochconverter.com. I'm not sure how you're generating the CSV file, but it may be possible to automate date conversion somehow during the export.

Please let me know if I can be of further assistance, and I'll be happy to take another look.

#492574

Hi Christian,

thank you for your help.
It's now resolved, I converted all my dates into a Epoch time and it's ok.

Thank you very much.

Regards

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.