[Resolved] strange info in error log wpml_translations
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing database errors related to collation issues in their WordPress error log, which mention WPML.
Solution: We recommend ensuring that all database tables and their columns have a consistent collation. Specifically, change any tables or columns with the collation "latin1_swedish_ci" to a unicode-aware collation such as "utf8mb4_unicode_ci" or "utf8mb4_unicode_520_ci". For WPML tables, use the "Fix WPML table collation" option available under WPML → Support → Troubleshooting. WPML Troubleshooting Options
If you're not comfortable making these changes yourself, you can ask your hosting provider for assistance. It's crucial to back up your database before making any changes. You can find more information on changing collation in the database here: Stack Overflow: Change Character Set and Collation
Please note that the solution provided might be outdated or not applicable to your case. If the issue persists, 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 necessary, do not hesitate to 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.
I am trying to: I see repeated entries in my WP error log that look like they have to do with WPML translations. It doesn't look right to see a url for hidden link in this. Have you seen this before? Can you confirm it could be a problem related to your plugin and what do you recommend I do?
Link to a page where the issue can be seen: It is in my error logs. I will paste the error below. See lines 2, 3, 4 mention wpml.
I expected to see: no errors
Instead, I got:
[22-Apr-2024 06:28:44 UTC] WordPress database error Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,COERCIBLE) for operation 'like' for query SELECT SQL_CALC_FOUND_ROWS wpsv_posts.ID
FROM wpsv_posts LEFT JOIN wpsv_icl_translations wpml_translations
ON wpsv_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT('post_', wpsv_posts.post_type)
WHERE 1=1 AND (((wpsv_posts.post_title LIKE '%CWNP CWISA-102 Exam | CWISA-102 Test Questions - Trustable Planform Supplying Reliable CWISA-102 Accurate Answers ✴ Search for 【 CWISA-102 】 and easily obtain a free download on ⮆ hidden link ⮄ 👔Discount CWISA-102 Code%') OR (wpsv_posts.post_excerpt LIKE '%CWNP CWISA-102 Exam | CWISA-102 Test Questions - Trustable Planform Supplying Reliable CWISA-102 Accurate Answers ✴ Search for 【 CWISA-102 】 and easily obtain a free download on ⮆ hidden link ⮄ 👔Discount CWISA-102 Code%') OR (wpsv_posts.post_content LIKE '%CWNP CWISA-102 Exam | CWISA-102 Test Questions - Trustable Planform Supplying Reliable CWISA-102 Accurate Answers ✴ Search for 【 CWISA-102 】 and easily obtain a free download on ⮆ hidden link ⮄ 👔Discount CWISA-102 Code%'))) AND (wpsv_posts.post_password = '') AND ((wpsv_posts.post_type = 'post' AND (wpsv_posts.post_status = 'publish' OR wpsv_posts.post_status = 'wc-ywraq-new' OR wpsv_posts.post_status = 'wc-ywraq-pending' OR wpsv_posts.post_status = 'wc-ywraq-expired' OR wpsv_posts.post_status = 'wc-ywraq-accepted' OR wpsv_posts.post_status = 'wc-ywraq-rejected')) OR (wpsv_posts.post_type = 'page' AND (wpsv_posts.post_status = 'publish' OR wpsv_posts.post_status = 'wc-ywraq-new' OR wpsv_posts.post_status = 'wc-ywraq-pending' OR wpsv_posts.post_status = 'wc-ywraq-expired' OR wpsv_posts.post_status = 'wc-ywraq-accepted' OR wpsv_posts.post_status = 'wc-ywraq-rejected')) OR (wpsv_posts.post_type = 'attachment' AND (wpsv_posts.post_status = 'publish' OR wpsv_posts.post_status = 'wc-ywraq-new' OR wpsv_posts.post_status = 'wc-ywraq-pending' OR wpsv_posts.post_status = 'wc-ywraq-expired' OR wpsv_posts.post_status = 'wc-ywraq-accepted' OR wpsv_posts.post_status = 'wc-ywraq-rejected')) OR (wpsv_posts.post_type = 'product' AND (wpsv_posts.post_status = 'publish' OR wpsv_posts.post_status = 'wc-ywraq-new' OR wpsv_posts.post_status = 'wc-ywraq-pending' OR wpsv_posts.post_status = 'wc-ywraq-expired' OR wpsv_posts.post_status = 'wc-ywraq-accepted' OR wpsv_posts.post_status = 'wc-ywraq-rejected')) OR (wpsv_posts.post_type = 'envira' AND (wpsv_posts.post_status = 'publish' OR wpsv_posts.post_status = 'wc-ywraq-new' OR wpsv_posts.post_status = 'wc-ywraq-pending' OR wpsv_posts.post_status = 'wc-ywraq-expired' OR wpsv_posts.post_status = 'wc-ywraq-accepted' OR wpsv_posts.post_status = 'wc-ywraq-rejected'))) AND ( ( ( wpml_translations.language_code = 'en' OR 0 ) AND wpsv_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','product','product_variation','ywraq-pdf-template','wpcf7_contact_form','slide','envira' ) ) OR wpsv_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','product','product_variation','ywraq-pdf-template','wpcf7_contact_form','slide','envira' ) )
It seems that some of your database tables have different collations, which may cause issues while executing certain SQL queries. It is recommended that all the database tables have the same collation.
You need to ensure that all the database tables and their columns with a collation of "latin1_swedish_ci" are changed to a unicode-aware collation like "utf8mb4_unicode_ci" or "utf8mb4_unicode_520_ci".
For WPML tables, you can try running the option "Fix WPML table collation" under WPML → Support → Troubleshooting.