This thread is resolved. Here is a description of the problem and solution.
Problem:
User wasn't able to switch to automatic translation thus not being able to translate anything.
There were following errors:
JS:
app.js?ver=4.6.5:425 Uncaught (in promise) TypeError: Reduce of empty array with no initial value at Array.reduce (<anonymous>) at app.js?ver=4.6.5:425:48217 at c (app.js?ver=4.6.5:368:5848) at Generator._invoke (app.js?ver=4.6.5:368:5601) at Generator.next (app.js?ver=4.6.5:368:6207) at n (app.js?ver=4.6.5:8:5774) at s (app.js?ver=4.6.5:8:5985) </anonymous>
DB error in debug log:
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND post_status = 'publish' AND source_language_c...' at line 9 for query SELECT translations.post_type, COUNT(translations.ID) FROM ( SELECT RIGHT(element_type, LENGTH(element_type) - 5) as post_type, posts.ID FROM wp_icl_translations INNER JOIN wp_posts posts ON element_id = ID LEFT JOIN wp_postmeta postmeta ON postmeta.post_id = posts.ID AND postmeta.meta_key = '_wpml_post_translation_editor_native' WHERE element_type IN () AND post_status = 'publish' AND source_language_code IS NULL AND language_code = 'en' AND ( SELECT COUNT(trid) FROM wp_icl_translations icl_translations_inner INNER JOIN wp_icl_translation_status icl_translations_status on icl_translations_inner.translation_id = icl_translations_status.translation_id WHERE icl_translations_inner.trid = wp_icl_translations.trid AND icl_translations_status.status NOT IN ('0','42') AND icl_translations_status.needs_update != 1 ) < 18 AND ( postmeta.meta_value IS NULL OR postmeta.meta_value = 'no' ) ) as translations GROUP BY translations.post_type; made by do_action('wp_ajax_wpml_action'), WP_Hook->do_action, WP_Hook->apply_filters, WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Right->chain, WPML\FP\Right->map, WPML\Ajax\Factory->WPML\Ajax\{closure}, WPML\FP\Just->map, WPML\FP\{closure}, call_user_func_array, WPML\Container\Container::execute, WPML\Auryn\Injector->execute, call_user_func_array, WPML\Auryn\Executable->__invoke, ReflectionMethod->invokeArgs, WPML\Posts\UntranslatedCount->run
Solution:
Reset the Automatic Translation setting by deleting "WPML(post-type)" key from "wp_options" table.
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.
This topic contains 22 replies, has 2 voices.
Last updated by 1 year, 10 months ago.
Assisted by: Waqas Bin Hasan.