Background of the issue:
I am trying to update to WPML 5.4.5 and WCML (latest version) but encountered issues. We’re getting a fatal error due to deprecated function calls and a type error in the core plugin logic. The error occurs when using `icl_get_string_translations_by_id()` and `icl_get_string_id()`, which are no longer available in WPML 5.4.5. Additionally, there is a type error in `WPML_Element_Translation_Package::add_custom_field_contents()` where `array_filter()` is applied assuming `get_post_meta()` always returns an array. Casting the result with `(array)` before `array_filter()` resolves this issue.
Symptoms:
Uncaught Error: Call to undefined function icl_get_string_translations_by_id() in /wp-content/plugins/woocommerce-multilingual/inc/class-wcml-wc-strings.php on line 177. Type error in `WPML_Element_Translation_Package::add_custom_field_contents()` due to incorrect assumption about `get_post_meta()` return type.
Questions:
Can you restore the deprecated functions for backward compatibility or refactor the WCML plugin to use the new recommended methods?
Can you provide a patch or fix for the type error in `WPML_Element_Translation_Package::add_custom_field_contents()`?
This ticket has been inactive for quite a while. I didn't get a reply from you. So, I've transformed this chat into a support ticket because you may still need our help. If you do, please reply to this ticket, and one of our supporters will continue helping you.
My last messages/questions to you were:
What steps do I need to take to reproduce this error?
Do you have the full version of this error, including the whole trace track?
If so, can you please share it with me?
Regards,
Itamar.
The topic ‘[Closed] Critical issues in WPML 5.4.5 – Deprecated function calls and type errors’ is closed to new replies.