Home›Support›English Support›[Resolved] Critical error when trying to open German translation for one page
[Resolved] Critical error when trying to open German translation for one page
This thread is resolved. Here is a description of the problem and solution.
Problem: The client encountered a fatal error when trying to start the German translation of the 'about us' page using WPML. The error message indicated an issue with the function
get_source_language_code()
on a boolean value in the file
functions-load-tm.php
. Other translations were working fine, and the issue seemed to be isolated to this specific page.
Solution: We first asked the client if the problem occurred with other pages and what the results were when creating a new page. We then requested a screenshot of the database table
wp_icl_translation_batches
to check for any missing AUTO INCREMENT in the indexes and to view the contents of the table.
Subsequently, we asked for temporary access to the client's site, both wp-admin and FTP, to further investigate the issue. We emphasized the importance of taking a full backup of the database and website before providing access. We recommended using the Duplicator plugin for this purpose and provided a link to the plugin: http://wordpress.org/plugins/duplicator/.
If you're experiencing a similar issue, we recommend checking your database for any anomalies and ensuring that you have a recent backup before making changes or providing access for support. It's also important to note that the solution provided here might be outdated or not applicable to your 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 none of these steps resolve the problem, please open a new support ticket with us 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.
Here is the message from WordPress regarding the error:
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.5.2
Active theme: Tsubaki (version 1.3.0)
Current plugin: WPML Multilingual CMS (version 4.6.10) PHP version 8.1.28
Error Details
=============
An error of type E_ERROR was caused in line 501 of the file /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php. Error message: Uncaught Error: Call to a member function get_source_language_code() on bool in /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php:501
Stack trace:
#0 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php(153): wpml_tm_create_ATE_job_creation_model(571, true)
#1 [internal function]: WPML_TM_ATE_Jobs_Actions->{closure}(571, 0)
#2 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_map(Object(Closure), Array, Array)
#3 [internal function]: WPML\FP\Fns::WPML\FP\{closure}(Object(Closure), Array)
#4 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)
#5 [internal function]: WPML\FP\Fns::WPML\FP\{closure}(Object(Closure), Array)
#6 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array)
#7 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php(152): WPML\FP\Fns::__callStatic('map', Array)
#8 /wordpress/core/6.5.2/wp-includes/class-wp-hook.php(324): WPML_TM_ATE_Jobs_Actions->added_translation_jobs(Array, 1, Object(WPML_TM_Translation_Batch))
#9 /wordpress/core/6.5.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#10 /wordpress/core/6.5.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#11 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1478): do_action('wpml_added_tran...', Array, 1, Object(WPML_TM_Translation_Batch))
#12 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-job-factory.php(112): TranslationManagement->send_jobs(Object(WPML_TM_Translation_Batch), 'post', 1)
#13 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php(164): WPML_Translation_Job_Factory->create_local_job('197', 'de', NULL, 'post_page', 1, '')
#14 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php(43): WPML\TM\Jobs\Manual->createLocalJob('197', '', 'de', 'post_page')
#15 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\TM\Jobs\Manual->createOrReuse(Array)
#16 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/editor/Editor.php(92): WPML\FP\Right->map(Array)
#17 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-queue/class-wpml-translations-queue.php(52): WPML\TM\Editor\Editor->open(Array)
#18 /wordpress/core/6.5.2/wp-includes/class-wp-hook.php(324): WPML_Translations_Queue->load(Object(WP_Screen))
#19 /wordpress/core/6.5.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#20 /wordpress/core/6.5.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#21 /wordpress/core/6.5.2/wp-admin/includes/class-wp-screen.php(424): do_action('current_screen', Object(WP_Screen))
#22 /wordpress/core/6.5.2/wp-admin/includes/screen.php(243): WP_Screen->set_current_screen()
#23 /wordpress/core/6.5.2/wp-admin/admin.php(212): set_current_screen()
#24 {main}
thrown
Please go to your database table wp_icl_translation_batches and share with me a screenshot of the indexes (is there an AUTO INCREMENT missing?) and another screenshot of it's contents (just the first few is OK)
Attached are some screenshots illustrating the status:
- when I press the "+" to start the translation german translation of the "about us" page, it crashes (this is the only page that crashes, other translations in german and other languages for any other pages are working fine)
- in the tab WPML > translations management > dashboard, it shows as if waiting for translation (see hourglass icon on the screenshot)
- in the tab WPML > translations management > jobs, I can see job complete for all other languages of the "about us" page (see screenshot) but the German translation job is not there at all (so I can't even cancel it)
I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)
**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **
I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.
NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.
Somehow, the translation has become available again without crashing. I could then complete and save it. This page seems now to work fine in all language.