Skip Navigation

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

Problem:
The client was unable to save post translations using the WPML Classic Translation Editor, experiencing infinite loading. The issue was traced to the handling of sticky posts.
Solution:
We discovered that the 'sticky_posts' option was missing in the database. To resolve this, we created a test post, enabled it as a sticky post, and then translated it into a second language. This allowed the client to save translations when using the WPML Classic Translation Editor. We recommend checking if this solution resolves the issue on your end.

Please note that this solution might be outdated or not applicable to your specific case. If the issue persists, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, please open a new support ticket at WPML support forum for further assistance.

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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by andreasP-26 2 weeks, 1 day ago.

Assisted by: Long Nguyen.

Author Posts
September 18, 2024 at 8:53 am

andreasP-26

Background of the issue:
I am trying to edit certain post translations but its infinit loading

Symptoms:

Questions:

September 18, 2024 at 10:06 am
September 18, 2024 at 10:37 am #16192437

andreasP-26

Hello how do i send you the debig file from here?

September 19, 2024 at 1:24 am #16195667

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

You can upload it to Google Drive or Dropbox ... and add the URL in your reply. Also, can you please share the FTP account? I will try to investigate the issue further if needed. Your next reply is set to private to share the info.
❌ IMPORTANT: Please backup your database and website before proceeding ❌

Looking forward to your reply.
Thanks

September 19, 2024 at 5:30 am
September 19, 2024 at 7:08 am #16196253

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I found the issue and fixed this on your site. It is related to the sticky post option in the previous ticket https://wpml.org/forums/topic/the-translations-for-a-certain-elementor-tempalte-are-not-being-saved/

There is an error in the debug log

[18-Sep-2024 09:38:02 UTC] PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, bool given in /var/www/webroot/visitcyprus_wp/webroot/wp-content/plugins/sitepress-multilingual-cms/inc/translation-jobs/helpers/wpml-save-translation-data-action.class.php:266
Stack trace:
#0 /var/www/webroot/visitcyprus_wp/webroot/wp-content/plugins/sitepress-multilingual-cms/inc/translation-jobs/helpers/wpml-save-translation-data-action.class.php(266): in_array()
#1 /var/www/webroot/visitcyprus_wp/webroot/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-editor/class-wpml-tm-editor-save-ajax-action.php(22): WPML_Save_Translation_Data_Action->save_translation()
#2 /var/www/webroot/visitcyprus_wp/webroot/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-editor/class-wpml-tm-editor-job-save.php(9): WPML_TM_Editor_Save_Ajax_Action->run()
#3 /var/www/webroot/visitcyprus_wp/webroot/wp-content/plugins/sitepress-multilingual-cms/classes/editor/ClassicEditorActions.php(39): WPML_TM_Editor_Job_Save->save()
#4 /var/www/webroot/visitcyprus_wp/webroot/wp/wp-includes/class-wp-hook.php(324): WPML\TM\Editor\ClassicEditorActions->saveJob()
#5 /var/www/webroot/visitcyprus_wp/webroot/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#6 /var/www/webroot/visitcyprus_wp/webroot/wp/wp-includes/plugin.php(517): WP_Hook->do_action()
#7 /var/www/webroot/visitcyprus_wp/webroot/wp/wp-admin/admin-ajax.php(192): do_action()
#8 {main}
  thrown in /var/www/webroot/visitcyprus_wp/webroot/wp-content/plugins/sitepress-multilingual-cms/inc/translation-jobs/helpers/wpml-save-translation-data-action.class.php on line 266

this is the code in the file sitepress-multilingual-cms/inc/translation-jobs/helpers/wpml-save-translation-data-action.class.php line 266

// set stickiness
// is the original post a sticky post?
$sticky_posts       = get_option( 'sticky_posts' );
$is_original_sticky = $original_post->post_type == 'post' && in_array( $original_post->ID, $sticky_posts );

Checking the database, table wp_options, I see the option "sticky_posts" doesn't exist. So I created a test post > enabled sticky for this post > translated it to second languages. Now I can save the translation when using WPML Classic Translation Editor.

Can you please confirm it works on your end?

September 19, 2024 at 7:12 am #16196262

andreasP-26

Give me a moment to test it!
but in a meanwile, can i ask - after next plugin update will i need to add this code again>?

September 19, 2024 at 7:17 am #16196270

andreasP-26

Yes it seems to be working! Thanks a lot Long!!
But please reply to my previous question.
Have a good day!

September 19, 2024 at 7:18 am #16196272

andreasP-26

Ahh i see you didnt add the code, it is the code that was causing error...
Ok my Friend! Thanks a lot, i will mar the Issue as resolved now!

andreasP-26 confirmed that the issue was resolved on 2024-09-19 07:19:10.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.