Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was trying to translate a product in WooCommerce using WooCommerce Multilingual. When clicking on the pencil or cog icon, a critical error occurred, indicating a TypeError in the WooCommerce Multilingual plugin.
Solution:
We recommended trying a workaround for a known issue that can occur even when the ACF plugin is not active. The client should follow the steps outlined in the Errata:

If the solution provided is not relevant due to being outdated or not applicable 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 the issue persists, please 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.

This topic contains 1 reply, has 2 voices.

Last updated by Prosenjit Barman 1 year, 2 months ago.

Assisted by: Prosenjit Barman.

Author Posts
April 17, 2024 at 10:48 pm #15535079

Mylene

I am trying to: Translate a product

Link to a page where the issue can be seen: admin

I expected to see: the translation page

Instead, I got: There has been a critical error on this website. Please check your site admin email inbox for instructions.

Basically, when I go in WooCommerce > WooCommerce Multilingual & Multicurrency and I click on the pencil icon or on the cog icon, i get an error message: There has been a critical error on this website. Please check your site admin email inbox for instructions.

Error Details
=============
An error of type E_ERROR was caused in line 612 of the file /home/synteexc/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php. Error message: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, string given in /home/synteexc/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php:612
Stack trace:
#0 /home/synteexc/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php(612): array_filter()
#1 /home/synteexc/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php(490): WCML_Editor_UI_Product_Job->add_custom_field_to_element_data()
#2 /home/synteexc/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php(84): WCML_Editor_UI_Product_Job->get_data()
#3 /home/synteexc/public_html/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-translation-editor.php(57): WCML_Editor_UI_Product_Job->__construct()
#4 /home/synteexc/public_html/wp-includes/class-wp-hook.php(324): WCML_Translation_Editor->fetch_translation_job_for_editor()
#5 /home/synteexc/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#6 /home/synteexc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-editor/class-wpml-translation-editor-ui.php(342): apply_filters()
#7 /home/synteexc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-editor/class-wpml-translation-editor-ui.php(185): WPML_Translation_Editor_UI->filter_the_model()
#8 /home/synteexc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-editor/class-wpml-translation-editor-ui.php(91): WPML_Translation_Editor_UI->output_model()
#9 /home/synteexc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-queue/class-wpml-translations-queue.php(78): WPML_Translation_Editor_UI->render()
#10 /home/synteexc/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-management.php(379): WPML_Translations_Queue->display()
#11 /home/synteexc/public_html/wp-includes/class-wp-hook.php(324): WPML_Translation_Management->translation_queue_page()
#12 /home/synteexc/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#13 /home/synteexc/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#14 /home/synteexc/public_html/wp-admin/admin.php(259): do_action()
#15 {main}
thrown

Yes, I have tried WPML > Support >  troubleshooting page, clear the cache, remove ghost, etc. Still the same problem. All plugins are up to date.

April 18, 2024 at 11:18 am #15537907

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're having. We are aware of a similar issue that sometimes occurs when the ACF plugin is in use. Although the ACF plugin is not currently active on your site(based on the WPML Debug Info), could you please still try implementing the workaround outlined in the Errata provided below?

- https://wpml.org/errata/advanced-custom-fields-php-fatal-error-uncaught-typeerror-array_filter-argument-1-array-must-be-of-type-array/

Let me know if it helps in solving the issue or if you need further assistance in this matter. I will be happy to assist.

Best regards,
Prosenjit

April 18, 2024 at 3:31 pm #15540015

Mylene

Yes! this worked immediatly, so I confirm that you don't need to have ACF to have this problem. Thank you for a quick and concise solution.