Background of the issue:
I was trying to check the server logs and noticed SQL errors after updating WPML String Translation to version 3.2.16. The issue can be seen on the page: hidden link. The error involves a missing column 'wpml_translations.language_code' in the SQL query.
Symptoms:
I am seeing hundreds of errors in the server logs: 'WordPress database error Unknown column 'wpml_translations.language_code' in 'where clause' for query SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (0 = 1) AND ((wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'paused' OR wp_posts.post_status = 'active' OR wp_posts.post_status = 'queued' OR wp_posts.post_status = 'finished' OR wp_posts.post_status = 'autoresponder' OR wp_posts.post_status = 'workflow'))) AND ( ( ( wpml_translations.language_code = 'de' OR (wpml_translations.language_code = 'de' AND wp_posts.post_type IN ( 'document_template' ) AND ( ( ( SELECT COUNT(element_id) FROM wp_icl_translations WHERE trid = wpml_translations.trid AND language_code = 'de') = 0) OR ( ( SELECT COUNT(element_id) FROM wp_icl_translations t2 JOIN wp_posts p ON p.id = t2.element_id WHERE t2.trid = wpml_translations.trid AND t2.language_code = 'de'" while reading response header from upstream.
Questions:
Why am I seeing SQL errors related to 'wpml_translations.language_code' after updating WPML String Translation?
How can I resolve the missing column error in the SQL query?