Skip Navigation

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

Problem:
You are trying to add translations to an Elementor template, which previously existed but now are missing. Although the editor shows them as 100% translated, they disappear after saving. Additionally, you encounter a fatal error when attempting to add translations through the WordPress editor, specifically a TypeError related to the

in_array()

function.
Solution:
We recommend the following steps to resolve the issue:
1. Access your database.
2. Navigate to the

wp_options

table.
3. Delete the option that might be causing the issue. This step is crucial as it seems related to the fatal error you are experiencing.
For more detailed guidance, you can refer to a similar issue discussed in our forum: WPML forum topic on fatal error when adding a translation.

Please note that this solution might be outdated or not applicable to your specific case. If the problem 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 necessary, do not hesitate to open a new support ticket 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 1 reply, has 2 voices.

Last updated by Long Nguyen 5 months ago.

Assisted by: Long Nguyen.

Author Posts
September 9, 2024 at 8:59 am #16154464

andreasP-26

Background of the issue:
I am trying to add translations to a certain Elementor template. I had them before, but now they are gone. When I try to add them, the editor shows them as 100% translated, but when I save and go back, they don't appear. When I try to add them through the WordPress editor, I get the following error: Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, bool given in /var/www/html/webroot/wp-content/plugins/sitepress-multilingual-cms/classes/menu-elements/class-wpml-admin-scripts-setup.php:143 Stack trace: #0 /var/www/html/webroot/wp-content/plugins/sitepress-multilingual-cms/classes/menu-elements/class-wpml-admin-scripts-setup.php(143): in_array('272203', false) #1 /var/www/html/webroot/wp/wp-includes/class-wp-hook.php(324): WPML_Admin_Scripts_Setup->wpml_js_scripts_setup('') #2 /var/www/html/webroot/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /var/www/html/webroot/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /var/www/html/webroot/wp/wp-admin/admin-header.php(146): do_action('admin_print_scr...') #5 /var/www/html/webroot/wp/wp-admin/edit-form-advanced.php(425): require_once('/var/www/html/w...') #6 /var/www/html/webroot/wp/wp-admin/post-new.php(75): require('/var/www/html/w...') #7 {main} thrown in /var/www/html/webroot/wp-content/plugins/sitepress-multilingual-cms/classes/menu-elements/class-wpml-admin-scripts-setup.php on line 143

Symptoms:
Translations for a certain Elementor template are not being saved. The editor shows them as 100% translated, but they don't appear after saving. Encountering a fatal error when trying to add translations through the WordPress editor.

Questions:
Why are the translations not being saved even though the editor shows them as 100% translated?
How can I resolve the fatal error encountered when adding translations through the WordPress editor?

September 9, 2024 at 9:28 am #16154900

Long Nguyen
Supporter

Languages: English (English )

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

Hi,

Here is the forum ticket. Let me know if the workaround helps you solve the issue on your site.

Looking forward to your reply.
Thanks

September 18, 2024 at 8:48 am #16191766

andreasP-26

I solved it by recreating the post