Skip Navigation

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

Problem:
The client was unable to access WPML settings or add a Language Switcher to the header. When attempting to do so, a critical error occurred in WordPress, indicating incompatibility with WooCommerce plugins. Disabling WPML resolved the issue.

Solution:
We recommended the following steps:
1. Take a full backup of the site and database.
2. Deactivate and delete the WPML plugin.
3. Download a fresh version of WPML from https://wpml.org/downloads/.
4. Access the database table

wp_options

.
5. Locate and delete the

icl_sitepress_settings

entry (caution is advised to not delete any other entries).
6. Reinstall and activate WPML.

We also emphasized the importance of having a recent and working backup before making any changes recommended by our team or a third party.

Please note that the solution provided might be outdated or not applicable to your case. If the issue persists, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, do not hesitate to open a new support ticket for further assistance at WPML support forum.

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Bobby 1 year, 1 month ago.

Assisted by: Bobby.

Author Posts
April 23, 2024 at 5:00 pm #15557635

florianL-33

I am trying to: Access WPML settings, add Language Switcher to Header

Link to a page where the issue can be seen: all pages

I expected to see: Language Switcher in Headers, WPML settings

Instead, I got: Critical error in WordPress when accessing WPML settings; WooCommerce plugins are not compatible to WooCommerce anymore, site headers won't show the language switcher

When disabling WPML, everything works again

Here's the detailed debug log: hidden link

Bildschirmfoto 2024-04-23 um 18.57.05.png
Bildschirmfoto 2024-04-23 um 18.56.04.png
Bildschirmfoto 2024-04-23 um 18.55.33.png
April 23, 2024 at 7:17 pm #15557872

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Taking a look at the debug log I can find the following fatal errors:

[23-Apr-2024 17:17:41 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /var/www/vhosts/hosting202938.a2e40.netcup.net/repairalliance.org/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112
[23-Apr-2024 17:17:44 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')			

Is this a new installation of WPML on this website?

Please try the following and let me know your results:

1. Take a full backup of your site and database

2. deactivate and delete WPML, then download a fresh version from https://wpml.org/downloads/

3. Go to your database table wp_options

4. Locate icl_sitepress_settings and delete it
(do not delete any other entries, working in the database requires caution)

5. Reinstall and activate WPML

Let me know your results, please.

NOTE: Always have a recent and working backup before making any changes recommended by our team or a 3rd party

April 23, 2024 at 7:26 pm #15557888

florianL-33

Thank you for your quick reply! It's relatively new, but we already have translations for 2 other languages. They won't be touched by deleting the db entry, right?

Cheers!

April 24, 2024 at 8:43 pm #15562688

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

They will not, it will look like you need to re-configure WPML after it's deleted, so go through the configuration and the translations will be there.

However, before making any major changes I do recommend having a full backup in place.

April 25, 2024 at 10:36 am #15564925

florianL-33

Thank you, it worked! I've seen that this issues isn't new, there's already some others who complained about the same thing. Maybe you could tweak your code to prevent errors like this?

April 25, 2024 at 7:02 pm #15567129

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I'm glad to hear it is resolved!

Our team is aware of this behavior and is working on a more permanent solution.