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