Home›Support›English Support›[Resolved] I cannot not save certaing post translations, there is infiniste saving loader
[Resolved] I cannot not save certaing post translations, there is infiniste saving loader
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.
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 ❌
[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.