Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 16 replies, has 2 voices.

Last updated by nicklasL-3 1 day, 14 hours ago.

Assisted by: Mateus Getulio.

Author Posts
October 18, 2024 at 2:53 pm

nicklasL-3

Background of the issue:
I am trying to prevent pages or custom post types from duplicating on their own. For example, two pages in custom post types are appearing automatically in English but with Spanish content. This can be checked in the admin. Link to a page where the issue can be seen: hidden link.

The hosting service provided some WPML errors that might be related to this issue.
PHP Warning: Undefined property: stdClass::$translation_id in /home/customer/www/staging4.ebslpdev.xyz/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/translation-jobs/jobs/wpml-post-translation-job.class.php on line 185.

Symptoms:
Pages or custom post types are duplicating on their own.

Questions:
Why are pages or custom post types duplicating on their own?

October 18, 2024 at 3:28 pm
October 19, 2024 at 8:14 am #16306832

nicklasL-3

Hi!
How is it going with the issue?
Thanks!

October 20, 2024 at 8:57 am #16308224

nicklasL-3

Additional info: Duplicated pages/courses/destinations are being currently duplicated in Spanish. Then, the original version is being set as a draft and a new version, with Spanish content, is being duplicated and published, but in English language.
Like in the screenshot, Vienna and Sydeny are currently drafts in the original Spanish version, while its content is being duplicated and brought in an English new page.
Hope this will help.

October 20, 2024 at 9:32 am #16308266

nicklasL-3

Rectification: Found pages duplicated not only in Spanish but also in another English language version.

Thanks.

October 21, 2024 at 5:28 am #16309947

nicklasL-3

Update: the staging website has been moved to staging2.barschool.net.

For trying to fix the error, in this staging version I went in WPML troubleshooting and applied the following:
Clear cache.
Remove ghost entries.
Fix element_type collation.
Fix WPML tables collation.

Since then, we continued working on this staging website and until now there were not any duplicate pages or other content - for the moment at least.

However, the WordPress sent an email this night - after some hours we made the previous troubleshooting updates and we still continued to work on the website - with the following:

WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, WPML Multilingual CMS.

First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.
Error Details
=============
An error of type E_ERROR was caused in line 193 of the file /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php. Error message: Uncaught InvalidArgumentException: No translation entry found for query: s:34:" trid = %d AND language_code = %s ";a:2:{i:0;s:5:"36691";i:1;s:2:"dk";} in /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php(65): WPML_TM_ICL_Translations->select_translation_id(' trid = %d AND ...', Array)
#1 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php(43): WPML_TM_ICL_Translations->build_from_trid(Array)
#2 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-records.php(155): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'trid_lang')
#3 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(67): WPML_TM_Records->icl_translations_by_trid_and_lang('36691', 'dk')
#4 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php(947): WPML_TM_Post_Actions->save_post_actions(85458, Object(WP_Post), false)
#5 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(324): wpml_tm_save_post(85458, Object(WP_Post), false)
#6 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#7 /home/customer/www/staging2.barschool.net/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php(213): do_action('wpml_tm_save_po...', 85458, Object(WP_Post), false)
#9 /home/customer/www/staging2.barschool.net/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-admin-post-actions.class.php(123): WPML_Post_Translation->after_save_post('36691', Array, 'de', 'en')
#10 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(326): WPML_Admin_Post_Actions->save_post_actions(85458, Object(WP_Post))
#11 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#12 /home/customer/www/staging2.barschool.net/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#13 /home/customer/www/staging2.barschool.net/public_html/wp-includes/post.php(4891): do_action('save_post', 85458, Object(WP_Post), true)
#14 /home/customer/www/staging2.barschool.net/public_html/wp-includes/post.php(4993): wp_insert_post(Array, false, true)
#15 /home/customer/www/staging2.barschool.net/public_html/wp-admin/includes/post.php(453): wp_update_post(Array)
#16 /home/customer/www/staging2.barschool.net/public_html/wp-admin/includes/post.php(2163): edit_post(Array)
#17 /home/customer/www/staging2.barschool.net/public_html/wp-admin/includes/misc.php(1355): wp_autosave(Array)
#18 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(326): heartbeat_autosave(Array, Array)
#19 /home/customer/www/staging2.barschool.net/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#20 /home/customer/www/staging2.barschool.net/public_html/wp-admin/includes/ajax-actions.php(3503): apply_filters('heartbeat_recei...', Array, Array, 'page')
#21 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(324): wp_ajax_heartbeat('')
#22 /home/customer/www/staging2.barschool.net/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#23 /home/customer/www/staging2.barschool.net/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#24 /home/customer/www/staging2.barschool.net/public_html/wp-admin/admin-ajax.php(192): do_action('wp_ajax_heartbe...')
#25 {main}
thrown

October 22, 2024 at 2:26 pm #16318035

nicklasL-3

Hello again,

Is there any news on the fix?

As said we moved to a new staging and even after the troubleshooting with:
Clear cache.
Remove ghost entries.
Fix element_type collation.
Fix WPML tables collation.

the issue has come up again, duplicating a page multiple times.

Thanks, looking forward to hear from you.

October 24, 2024 at 1:02 pm #16326409

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I sincerely apologize for the delay with this case. I was asking my colleagues to take a look at the issue as well.

I want to take a look at the new staging site you created before I share our conclusions.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link

Please, let me know if you need any additional details. Have a nice day.

October 24, 2024 at 1:18 pm
October 24, 2024 at 8:51 pm #16328472

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

It looks like the duplicated pages have been removed, possibly by you. Could you please confirm if you deleted them?

In order to investigate this further, I need to know approximately when the last occurrence of this issue happened. If you can recall the day and time, that would be very helpful. Also, could you provide the hosting error logs for that period? This could give us more insight into what triggered the duplications. You can upload them to the server and let me know the location. I will use a file manager plugin and retrive them, or you can use a file sharing system such as dropbox, google drive or similar to share that with me.

Additionally, if you have any specific steps or actions that seem to lead to the issue, please let me know. I've been trying to replicate the error, but so far, I haven't been able to reproduce either the duplicated pages or the fatal error so far but I'm unsure of the exact steps I need to take in order to make them happen.

Thank you for your help, and I look forward to your response so we can work together to fix this.

Best regards,
Mateus

October 24, 2024 at 9:01 pm #16328477

nicklasL-3

Hi Mateus!

On the new staging2.barschool we encountered only this duplication as in the image (duplicated are the one not translated).

I sent them to trash and they still should be there. One team member told me they were there on Tuesday around 3:20 pm CET.

Many thanks for your help, hopefully we can find a solution!

Screenshot 2024-10-24 at 22.57.57.png
October 27, 2024 at 2:44 pm #16334841

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for your patience.

After investigating the issue, I can confirm that WPML does not appear to be involved in the duplication of these pages you shared as an example. Here's a summary of what we checked:

1. WPML Translations: We queried the WPML translation tables and found no connections or translation jobs linked to the duplicated posts. This suggests WPML is not duplicating or managing these pages.
2. Post Metadata: We also checked for any WPML-related meta keys in the post metadata, and there were none present. Again, this further confirms that WPML is not involved in the issue.
3. No Translation Jobs: Additionally, there are no translation jobs for these posts, which rules out WPML-related activities such as automatic translation or duplication.

Since WPML seems unrelated so far, I would like to take the following approach to help diagnose the issue:

1. Enable Debugging: I enabled WordPress debugging, which will log any errors that occur on your site. This should help us catch any issues as they happen. The error logs I asked previously will help as well if you can get them.

2. Activity Monitoring Plugin: I installed a plugin that monitors the system activities. This will allow us to track when posts are being duplicated and by what process.

3. Monitoring: Now that those are in place, I kindly ask you to let us know immediately when you notice pages duplicating again. This will allow us to review the logs in real-time to try to determine the cause. We might not be able to especially if it is really not WPML related, but we're doing all we can to help you.

Thank you for your patience and please let us know if you face any duplications in the new staging site.

Best regards,
Mateus

October 27, 2024 at 6:10 pm #16335152

nicklasL-3

Thanks for the support Mateus,

I'll let you know when another duplication will happen. Many thanks for everything!

Best regards.

October 29, 2024 at 9:18 am #16340873

nicklasL-3

Hello there,

For now looks like there's no problem with duplication, and we need to deploy to prod in the next days. Do you recommend to go out of the debug mode for the live website?

Thanks!

October 29, 2024 at 2:26 pm #16342895

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

You can switch off the debug mode, the log can grow considerably large if we let it enabled for many days while the site is in production.

I tried doing it for you but it looks like there's a basic auth in place now preventing me from accessing the site.

Please give it a try and let me know if you face dificulties.

Thank you, please let us know.