Skip Navigation

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

Problem:

When trying to add Translation the following fatal error occurs:

Fatal error: Uncaught Error: Call to a member function get_source_language_code() on bool
in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php on line 496
Call stack:
wpml_tm_create_ATE_job_creation_model()
wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php:153
WPML_TM_ATE_Jobs_Actions::{closure}()
array_map()
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php:164 ...

Solution:

- Backup the site completely to prevent any issues and for a reference point.

- Go to: WordPress Dashboard -> WPML -> Support page, Click on the "Troubleshooting" link there

- Click on the Clear and Fix options there like the following options except for the Reset options. Those options will fix any translation and Database issues if there are any.

Clear the Cache in WPML
Remove ghost entries from the translation tables
Fix element_type collation
Fix WPML table collation
Set language information
Cleanup and optimize string tables
Synchronize local job ids with ATE jobs

Relevant Documentation:

https://wpml.org/documentation/support/wpml-troubleshooting-options/

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 3 replies, has 2 voices.

Last updated by Subash Chandra Poudel 1 year, 8 months ago.

Assisted by: Subash Chandra Poudel.

Author Posts
April 18, 2023 at 10:40 am #13494655

Marketing Tech

Just a while ago, we experience a fatal error when adding our translation using ATR:
Here is the error message that we got:

Fatal error: Uncaught Error: Call to a member function get_source_language_code() on bool
in /var/www/html/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php on line 496
Call stack:
wpml_tm_create_ATE_job_creation_model()
wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php:153
WPML_TM_ATE_Jobs_Actions::{closure}()
array_map()
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php:164
WPMLFPFns::WPMLFP{closure}()
call_user_func_array()
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php:154
WPMLFPFns::WPMLFP{closure}()
call_user_func_array()
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php:56
WPMLFPFns::__callStatic()
wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php:152
WPML_TM_ATE_Jobs_Actions::added_translation_jobs()
wp-includes/class-wp-hook.php:308
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:332
WP_Hook::do_action()
wp-includes/plugin.php:517
do_action()
wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php:1454
TranslationManagement::send_jobs()
wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-job-factory.php:101
WPML_Translation_Job_Factory::create_local_job()
wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php:101
WPMLTJManual::createLocalJob()
wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php:33
WPMLTJManual::createOrReuse()
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php:207
WPMLFPRight::map()
wp-content/plugins/sitepress-multilingual-cms/classes/editor/Editor.php:85
WPMLTEEditor::open()
wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-queue/class-wpml-translations-queue.php:52
WPML_Translations_Queue::load()
wp-includes/class-wp-hook.php:308
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:332
WP_Hook::do_action()
wp-includes/plugin.php:517
do_action()
wp-admin/includes/class-wp-screen.php:424
WP_Screen::set_current_screen()
wp-admin/includes/screen.php:243
set_current_screen()
wp-admin/admin.php:212

and now when we try to add translation we only see a blank ATE

April 18, 2023 at 11:28 am #13495001

Subash Chandra Poudel

Hi there,

Can you please Backup the site completely to prevent any issues then:

- Go to: WordPress Dashboard -> WPML -> Support page, Click on the "Troubleshooting" link there

- Click on the Clear and Fix options there like the following options except for the Reset options. Those options will fix any translation and Database issues if there are any.

Clear the Cache in WPML
Remove ghost entries from the translation tables
Fix element_type collation
Fix WPML table collation
Set language information
Cleanup and optimize string tables
Synchronize local job ids with ATE jobs

Then see if it fixes the issue?

Regarding the cause of the issue, this could be a glitch due to server restrictions or some interference from third party plugins. If the issue occurs again and again we can look into further but for that we need a clear step by step process to recreate the issue on your or a clean site.

Please let me know how it goes.

Regards,
Subash

April 20, 2023 at 4:38 am #13508681

Marketing Tech

Hello,

This is to confirm that after doing the steps above our issue was resolved. Thank you for your assistance.

April 20, 2023 at 6:12 am #13508807

Subash Chandra Poudel

Hi there,

Thank you for confirming that the issue is resolved now.

Please feel free to contact us again if you need any further help or have any queries.

Regards,
Subash