 kellyS-6
|
Background of the issue:
I am trying to translate pages using WPML and access the Translation Management section. We encountered repeated fatal errors during these attempts. We have tried using the cleanup tools in WPML > Support > Troubleshooting, but the issue persists. We also checked the database schema and found that there is no column named batch_id in the translation_status table.
Symptoms:
PHP Fatal error: Uncaught InvalidArgumentException: Unknown column: rid or invalid id: 0 in .../class-wpml-tm-icl-translation-status.php:36. PHP Fatal error: Uncaught WPMLCorePortPersistenceExceptionDatabaseErrorException: Unknown column 'ts.batch_id' in 'on clause' in .../QueryHandler.php:57.
Questions:
Could you please advise if there's a fix or database migration patch for this?
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
Hi,
batch_id should be there - see my screenshot on how this table should look like.
You could try adding it through cPanel e.g. or perhaps:
ALTER TABLE wp_icl_translation_status
ADD COLUMN batch_id INT NOT NULL DEFAULT 0;
|
 kellyS-6
|
we have created the column using the given query but now when we try to translate a page we are facing below fatal error
WordPress database error Unknown column 'field_wrap_tag' in 'field list' for query INSERT INTO wp_icl_translate ......
PHP Fatal error: Uncaught Error: Call to a member function get_source_language_code() on bool in ....
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
Based on the errors you've shared, it seems the WPML database structure is incomplete or corrupted.
Since you've already tried using WPML’s troubleshooting tools and manually added the `batch_id` column without resolving the issue, I believe the core problem lies in an improper or incomplete initial setup.
If this is a new WPML installation and there are no existing translations that need to be preserved, I recommend performing a full reset of WPML. This will allow the plugin to recreate all necessary tables and start fresh, likely resolving the database-related fatal errors.
You can follow WPML’s official guide to perform the reset here:
https://wpml.org/documentation/getting-started-guide/language-setup/deleting-languages-and-plugin-data-by-doing-a-wpml-reset-on-your-site/#step-3-do-the-wpml-reset
|
 kellyS-6
|
This is a old WPML Setup and it was working fine before this issue has surfaced recently in the site and i cannot reset it as the site currently has a lot of pages translated into multiple languages.
Is there anything else that we can try to resolve this issue ?
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
Something has corrupted these tables, and I'm afraid the only solution is to check and fix them manually.
I’ve created a sandbox site for this purpose:
hidden link
The "WP phpMyAdmin" plugin is available on the site, so you can use it to compare your broken tables with the correct structure and make the necessary fixes.
|
 kellyS-6
|
So Creating missing columns should fix this issue without breaking already translated pages. is that correct ?
If yes then we will proceed with creating columns for which we face the issue.
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
That's correct, I see no other way. Perhaps it is the only column 'field_wrap_tag' missing and others are were not affected with this.
|
 kellyS-6
|
We've created that column in the needed table now only this single error is
[09-May-2025 11:07:13 UTC] PHP Fatal error: Uncaught InvalidArgumentException: Unknown column: rid or invalid id: 0 in ..../wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translation-status.php:36
Other than this there is no DB related error.
Can you suggest anything other than reseting the plugin as we cannot do that it will reset all the translations.
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
For the "rid" column within wp_icl_translation_status, is any value 0? If so, delete this row. Also make sure that there is AUTO_INCREMENT set for it (and other icl_ tables as well).
|
 kellyS-6
|
I've cheked rid is nowhere 0 and also that column is auto increment as well, too.
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
Would you be willing to provide me with WordPress and FTP credentials so I could investigate the issue directly?
Also install https://wordpress.org/plugins/wp-phpmyadmin-extension/ or https://wordpress.org/plugins/pexlechris-adminer/
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
I marked your next reply as private so that you can safely add credentials.
And to confirm, the error would trigger if I enter any page and just click the + button so I could translate it, or something else needs to be done?
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
Can you install https://wordpress.org/plugins/wp-phpmyadmin-extension/ or https://wordpress.org/plugins/pexlechris-adminer/ so I could check database tables?
|
 Bruno Kos
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
French (Français )
Timezone:
Europe/Zagreb (GMT+02:00)
|
I am checking this with our 2nd tier and will keep you posted.
|