Background of the issue:
I was trying to access the WPML plugin in the website backend, but encountered an error. The error was caught by WordPress, which notified me via email. I was advised to visit my website (hidden link) and the specific page where the error occurred (hidden link) to check for visible issues. Additionally, I was informed about WordPress's 'recovery mode' feature, which allows safe login to the dashboard for further investigation. The error details include a PHP error related to a missing database table: 'teamalb2_wp_01.wpx_icl_translate_job'.
Symptoms:
An error of type E_ERROR was caused in line 76 of the file /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Infrastructure/WordPress/Port/Persistence/QueryHandler.php. Error message: Uncaught WPMLCorePortPersistenceExceptionDatabaseErrorException: Table 'teamalb2_wp_01.wpx_icl_translate_job' doesn't exist.
Questions:
How can I resolve the error with the WPML Multilingual CMS plugin?
What steps should I take if the database table 'teamalb2_wp_01.wpx_icl_translate_job' is missing?
Looks like somehow the said table (icl_translate_job) was not created or removed. Please follow these steps:
- Access your database via database administration plugin or directly via your hosting panel's DB admin (i.e. phpMyAdmin).
- Check if the said table 'wpx_icl_translate_job' in 'teamalb2_wp_01' database exists?
- Probably that doesn't and if this is the case as I suspect, please run the following query carefully: IMPORTANT: Please take full backup of your website and database beforehand.
It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
CREATE TABLE `wpx_icl_translate_job` (
`job_id` bigint(20) UNSIGNED NOT NULL,
`rid` bigint(20) UNSIGNED NOT NULL,
`translator_id` int(10) UNSIGNED NOT NULL,
`translated` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
`manager_id` int(10) UNSIGNED NOT NULL,
`revision` int(10) UNSIGNED DEFAULT NULL,
`title` varchar(160) DEFAULT NULL,
`deadline_date` datetime DEFAULT NULL,
`completed_date` datetime DEFAULT NULL,
`editor` varchar(16) DEFAULT NULL,
`editor_job_id` bigint(20) UNSIGNED DEFAULT NULL,
`edit_timestamp` int(11) UNSIGNED DEFAULT NULL,
`automatic` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `wpx_icl_translate_job`
--
ALTER TABLE `wpx_icl_translate_job`
ADD PRIMARY KEY (`job_id`),
ADD KEY `rid` (`rid`,`translator_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `wpx_icl_translate_job`
--
ALTER TABLE `wpx_icl_translate_job`
MODIFY `job_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
And then finally recheck. Here's also the list of WPML tables for a reference.
Regards.
P.S.: For the other issue (i.e. 404), I recommend opening a separate ticket/chat because as per forum policy we can only handle one issue per ticket/chat. So you can get more to the point help, without mixing up several issues in one long ticket.
WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, WPML Multilingual CMS.
First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.
hidden link
To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.7.2
Active theme: Woodmart (version 7.6.0)
Current plugin: WPML Multilingual CMS (version 4.7.1)
PHP version 8.0.30
Error Details
=============
An error of type E_ERROR was caused in line 76 of the file /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Infrastructure/WordPress/Port/Persistence/QueryHandler.php. Error message: Uncaught WPML\Core\Port\Persistence\Exception\DatabaseErrorException: Unknown column 'automatic' in 'where clause' in /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Infrastructure/WordPress/Port/Persistence/QueryHandler.php:76
Stack trace:
#0 /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Infrastructure/WordPress/Component/Translation/Application/Query/JobQuery.php(41): WPML\Infrastructure\WordPress\Port\Persistence\QueryHandler->querySingle()
#1 /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Core/Component/Dashboard/Application/DashboardController.php(361): WPML\Infrastructure\WordPress\Component\Translation\Application\Query\JobQuery->hasAnyAutomatic()
#2 /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/CompositionRoot/Config/Config.php(178): WPML\UserInterface\Web\Core\Component\Dashboard\Application\DashboardController->initialScriptData()
#3 /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/CompositionRoot/Config/Config.php(112): WPML\UserInterface\Web\Infrastructure\CompositionRoot\Config\Config->loadScripts()
#4 /home7/teamalb2/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/UserInterface/Web/Infrastructure/WordPress/CompositionRoot/Config/AdminPage.php(20): WPML\UserInterface\Web\Infrastructure\CompositionRoot\Config\Config->onLoadPage()
#5 /home7/teamalb2/public_html/wp-includes/class-wp-hook.php(324): WPML\UserInterface\Web\Infrastructure\WordPress\CompositionRoot\Config\AdminPage->WPML\UserInterface\Web\Infrastructure\WordPress\CompositionRoot\Config\{closure}()
#6 /home7/teamalb2/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#7 /home7/teamalb2/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /home7/teamalb2/public_html/wp-admin/admin.php(237): do_action()
#9 {main}
thrown This is the current error message
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpx_posts.ID FROM wpx_posts INNER JOIN wpx_postmeta ON ( wpx_posts.ID = wpx_postmeta.post_id ) JOIN wpx_icl_translations wpml_translations ON wpx_posts.ID = wpml_translations.element_id AND wpml_translations.element_type = CONCAT('post_', wpx_posts.post_type) WHERE 1=1 AND ( ( wpx_postmeta.meta_key = '_wp_page_template' AND wpx_postmeta.meta_value = 'portfolio.php' ) ) AND wpx_posts.post_type = 'page' AND ((wpx_posts.post_status = 'publish')) AND ( ( ( wpml_translations.language_code = 'en' OR 0 ) AND wpx_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) ) OR wpx_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation' ) ) GROUP BY wpx_posts.ID ORDER BY wpx_posts.post_title ASC
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpx_posts.ID FROM wpx_posts INNER JOIN wpx_postmeta ON ( wpx_posts.ID = wpx_postmeta.post_id ) JOIN wpx_icl_translations wpml_translations ON wpx_posts.ID = wpml_translations.element_id AND wpml_translations.element_type = CONCAT('post_', wpx_posts.post_type) WHERE 1=1 AND ( ( wpx_postmeta.meta_key = '_wp_page_template' AND wpx_postmeta.meta_value = 'portfolio.php' ) ) AND wpx_posts.post_type = 'page' AND ((wpx_posts.post_status = 'publish')) AND ( ( ( wpml_translations.language_code = 'en' OR ( wpml_translations.language_code = 'en' AND wpx_posts.post_type IN ( 'e-floating-buttons' ) AND ( ( ( SELECT COUNT(element_id) FROM wpx_icl_translations WHERE trid = wpml_translations.trid AND language_code = 'en' ) = 0 ) OR ( ( SELECT COUNT(element_id) FROM wpx_icl_translations t2 JOIN wpx_posts p ON p.id = t2.element_id WHERE t2.trid = wpml_translations.trid AND t2.language_code = 'en' AND ( p.post_status = 'publish' OR p.post_status = 'private' OR ( p.post_type='attachment' AND p.post_status = 'inherit' ) ) ) = 0 ) ) ) ) AND wpx_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','e-floating-buttons','elementor_library','cms_block','woodmart_slide' ) ) OR wpx_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','e-floating-buttons','elementor_library','cms_block','woodmart_slide' ) ) GROUP BY wpx_posts.ID ORDER BY wpx_posts.post_title ASC
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(61)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(80)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(62)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(78)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(63)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(64)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(136)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(69)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(70)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(66)
WordPress database error: [Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '=']
SELECT wpml_translations.translation_id, wpml_translations.element_id, wpml_translations.language_code, wpml_translations.source_language_code, wpml_translations.trid, wpml_translations.element_type FROM wpx_icl_translations wpml_translations JOIN wpx_term_taxonomy tax ON wpml_translations.element_id = tax.term_taxonomy_id AND wpml_translations.element_type = CONCAT('tax_', tax.taxonomy) JOIN wpx_icl_translations tridt ON tridt.element_type = wpml_translations.element_type AND tridt.trid = wpml_translations.trid WHERE tridt.element_id IN(67)
Thank you for the updates. I've removed all the credentials from the public messages due to safety reasons.
Please DO NOT share the sensitive access information in public messages or these may fall into wrong hands. Always ask to enable the private message when needed.
I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.
Your next answer will be private, to share this information safely.
Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend.
IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.
Thank you for the access, I was able to fix the issue.
There were several tables missing and some with incorrect or missing fields. I'm not sure why this'd happen. However, for now I 've fixed all the tables.
I was also not sure what's the default language, however, based on some digging I found English being the default language while several other languages were added. Out of these only English and Greek were active in the WPML Tables.
So I've set English as default while Greek as secondary language. Please feel free to add more languages and/or change default language as needed.
I've also turned off Automatic Translation for now, feel free to turn it back on as needed from WPML -> Translation Mangaement.