Skip to content Skip to sidebar

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 2 replies, has 2 voices.

Last updated by philippeM-34 3 years, 6 months ago.

Assisted by: Bigul.

Author Posts
June 20, 2022 at 9:00 am #11497021

philippeM-34

Fatal error while trying to translate

PHP Fatal error: Uncaught InvalidArgumentException: Argument $language_code must be a non empty string. in /home/directadmin22/domains/baikushop.be/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:77

Here you can find a URL to the debug log, there are definitely some errors referring to WPML. https://pastebin.com/8TxSdj06

June 20, 2022 at 9:27 am #11497417

Bigul

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

The Debug log is showing the following fatal error a few times. Please translate a post or page and make sure this error is still tracked in debug.log.


PHP Fatal error: Uncaught InvalidArgumentException: Argument $language_code must be a non empty string. in /home/directadmin22/domains/baikushop.be/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:77

We had a similar error in the past and it was fixed in the latest version of WPML. Please refer to the following links for more details.

https://wpml.org/forums/topic/critical-error-on-plugin-activation/

https://wpml.org/errata/a-fatal-error-is-thrown-on-front-end-when-a-menu-is-assigned-to-a-location-and-wpml-setup-is-not-complete/

If the Fatal error exists in debug.log, please try the following troubleshooting steps after a full site backup{mandatory} and make sure the issue is existing or not.

1) Go to WPML>>Support page, click on the Troubleshooting link (blue link in the middle of the page)

2) On the Troubleshooting page, please click on the following options of the *Clean up* section. Wait for confirmation of processing after each one.

- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Fix WPML tables collation
- Assign translation status to duplicated content
- Synchronize local job ids with ATE jobs
- Fix terms count
- Fix post-type assignment
- Cleanup and optimize string tables

--
Thanks!

Bigul