[Resolved] Fatal Error When Attempting to Translate Pages in WPML
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing fatal errors when trying to access the Translation Management section in WPML, due to missing 'batch_id' column and incorrect data type for 'translation_package' column in the 'wp_icl_translation_status' table. Solution: First, add the missing 'batch_id' column by executing the following SQL command:
ALTER TABLE wp_icl_translation_status ADD COLUMN batch_id INT NOT NULL DEFAULT 0;
Next, change the data type of the 'translation_package' column to 'longtext' to prevent data corruption. Run this SQL command:
ALTER TABLE wp_rascg4p5t7_icl_translation_status CHANGE translation_package translation_package LONGTEXT COLLATE 'utf8mb4_unicode_ci' NOT NULL AFTER translation_service;
After updating the database, follow these steps to clean up and resend the affected translation: 1. Identify the original post ID. 2. In the 'icl_translations' table, locate the 'trid' for that post ID. 3. Use the 'trid' to filter records in the same table and remove any rows where the 'element_id' column is 'NULL'. 4. Go to WPML > Packages in the WordPress admin and delete the package with the identified ID. 5. Resend the content for translation as usual, following the instructions here: Translating Your Contents.
If these steps do not resolve your issue, or if the solution seems outdated or irrelevant to your case, 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 problems persist, please open a new support ticket at WPML Support Forum.
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.
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?
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 ....
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.
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 ?
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.
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).
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.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.