Skip Navigation

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

Problem:
The client encountered a PHP Fatal error on the Translations Jobs tab, indicating an issue with calling a function on a boolean value in the WPML plugin code.
Solution:
We resolved the issue by repairing the corrupted WPML tables in the database. We executed a series of SQL queries to alter the tables and set the correct auto-increment values. Here are the queries we used:

ALTER TABLE `wp_icl_translation_batches`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_translate_job`
CHANGE `job_id` `job_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_translate`
CHANGE `tid` `tid` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

DELETE FROM `wp_icl_strings`
WHERE ((`id` = '0'));

ALTER TABLE `wp_icl_strings`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_batches`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_packages`
CHANGE `ID` `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_positions`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_translations`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_status`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_languages_translations`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_languages`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST;

... (and similar queries for other WPML tables).
We asked the client to check if the issue was resolved after applying these changes.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If you're still experiencing issues, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us.

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

Last updated by tamasF-3 8 months ago.

Assisted by: Bigul.

Author Posts
March 18, 2024 at 3:46 pm

Trevor

The Translations Jobs tab shows the following error

PHP Fatal error: Uncaught Error: Call to a member function get_source_language_code() on bool in /www/bovill2021_371/public/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php:501

March 18, 2024 at 5:08 pm
March 19, 2024 at 2:00 pm #15426856

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

The bug exists after the initial troubleshooting steps. So we are looking for possible workarounds now. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

March 19, 2024 at 4:32 pm #15427695

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

This bug was happening becuase a few of the WPML tables in the database were somehow corrupted. It works as expected after running the following queries via Adminer in the staging site.

ALTER TABLE `wp_icl_translation_batches`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_translate_job`
CHANGE `job_id` `job_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_translate`
CHANGE `tid` `tid` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

DELETE FROM `wp_icl_strings`
WHERE ((`id` = '0'));

ALTER TABLE `wp_icl_strings`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_batches`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_packages`
CHANGE `ID` `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_positions`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_translations`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_string_status`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_languages_translations`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST;

ALTER TABLE `wp_icl_languages`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST;

Please check it now and let us know your feedback.

--
Thanks!

Bigul

March 22, 2024 at 9:17 am #15439430

Trevor

Thank you for all the help this appears to be fully working. Any issues i let you know, but so far all good..

March 25, 2024 at 10:49 am #15445882
tamasF-3

Hi,

I have a similar error, but the solution you have provided did not work.

I get this error, when I try to click on Translate with ATE (custom post type Portfolio from Enfold Theme).

Also, when I try to Translate via Translation manager: I select all Portfolios, send to Translation basket, assign Translator there and click on Send, the spinning animation runs and nothing happens.

I need your help. Thanks!