[Resolved] Errors when changing the default language within WPML
This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was getting this error when she tried to go to Appearance > Menus, after she changed the default language on the site: "There has been a critical error on this website. Please check your site admin email inbox for instructions."
Solution:
That is a general error message and we can't know what is causing the error until we don't dig a bit deeper.
Now, we can try to reproduce the issue once again.
We should now be able to locate the debug log in: /wp-content/debug.log
Paste the content (if any) on a site like pastebin.com and then share the link with our supporters in your existing ticket (only you and us will see the URL you are sharing, it is automatically hidden for anyone else).
I changed the main language from Spanish to English and lost the multi language item from my menu, and when I try to go to Appearance/Menus on the backend of WP I get an error. The website is working but the links on Home are broken as well as the Contact Us link, and the flags are gone, when I try to re-add them within WPML, they disappear.
Mihai, I have moved the plugin to a temp folder because I couldn’t disable it, I can access the menus page now but when I try to create the Menu Language Switcher, although I do it and save it, it’s gone when I reload the page.
I missed that part with the flags - I focused on the fatal error.
1. This issue looks to me like it could be either caused by server-related causes or a compatibility issue between WPML and (at least) one of the active plugins or the active theme.
Can you please let me know if this issue happens even when only the WPML plugins are active and you are using a default WordPress theme?
Please try the following steps so that we would test for a compatibility-related issue:
- create a full website backup
- disable all plugins except WPML and its add-ons
- check if the issue is happening again
- if it's not, reactivate your plugins one by one, checking every time if the issue shows up again so that you can understand which plugin is causing that issue
If the issue happens even with the non-WPML plugins disabled:
- leave all the non-WPML plugins deactivated
- switch to a default theme like TwentySeventeen
- try to recreate the issue now
If you have the chance, it would be best to do this in a staging (testing) environment.
Please let me know how that goes and if following any of these steps solved your issue or brought any change.
2. If no change is happening, can you create a full website backup and then update the WPML plugins to the beta versions and see if the issue gets resolved?
Or test this in a testing/staging environment if you can't create a backup first?
- Can you install this beta: version 3.2.8-b.1 https://wpml.org/download/wpml-string-translation/?section=changelog
Would it help if I give you access to the backend of the website?
I found an fatal error on the Error_log of my site:
Uncaught Error: Class "WPML\ST\MO\WPLocaleProxy" not found in /home3/kpalrfmy/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:111