This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by nicolasG-25 10 months, 3 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
July 5, 2019 at 12:18 am


I'm trying to duplicate a post type to two languages, and then edit the texts inside it. But when I click the duplicate button in admin post type page, it only duplicates one language(ex: pt) ?

I´ve disabled all plugins except the plugins that involve this workflow and I also have the debug mode activated. Although I can not deactivate the theme because the post type involved is created within this theme, which I am developing.

Archive page: hidden link

Single Work: hidden link

I just wanted to duplicate each post with its respective fields in it and then change the texts.

I have read documentation and take advice to solve this issue like the ones I leave below but I have not been able to solve it.

hidden link

hidden link

if you need some access data to solve this issue, you just have to ask me and I will gladly give you access.

Beforehand thank you very much!

July 5, 2019 at 10:39 am #4150353

Bruno Kos

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)


Thank you for contacting WPML support!

I can see the issue and I used provided FTP access to read debug.log for possible error messages. And is what I got:

[05-Jul-2019 10:20:24 UTC] Error Column 'post_id' cannot be null de la base de datos de WordPress para la consulta INSERT INTO `xfiuRziaaMapaUY_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (NULL, 'photos_15_video', '') realizada por do_action('wp_ajax_make_duplicates'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WPML_Meta_Boxes_Post_Edit_Ajax->duplicate_post, TranslationManagement->make_duplicates, TranslationManagement->make_duplicate, SitePress->make_duplicate, WPML_Post_Duplication->make_duplicate, WPML_Post_Duplication->run_wpml_actions, WPML_Post_Duplication->duplicate_custom_fields

This indicates that there is a corrupted value in database, probably belonging to one of the Work custom posts. For example, when I tried doing it for MCU, it worked, but I did not work for SAC and CAP for example. However, for each next Work I created, the issue is no longer there and I duplicate them without problems. the explanation could be that for some reason, wp_postmeta table has not filled in properly, possibly due to way you may have created them ( using some plugins such as Fakerpress?)

Therefore, it seems like some of these Work posts are corrupted in database. Can you do the following?
- delete all the non working Work posts
- start creating new and see the issue is still there
- open database management ( something like phpMyAdmin) and check within wp_postmeta table if there is a post_id with the NULL value.
-- If yes, can you remove that entry altogether ( make a full database backup before you do it)

Bruno Kos

July 5, 2019 at 3:18 pm #4152339


Thank you Bruno ... after you gave me some guidance, I managed to solve it quickly by duplicating each post and going through the process again.

Thanks you very much!