Skip Navigation

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.

In this situation, we were able to find out (after following the steps we are sharing below) that the fatal error was caused by a different plugin (https://wpml.org/forums/topic/errors-when-changing-the-default-language-within-wpml/#post-14308629).

Let us share the steps that we can use to find out more about what is the actual error when we see a general error message like that one.

We can enable the WordPress debug log and recreate the issue to see if we are getting a longer error message that is more specific.

This will allow us to see if any PHP errors are being produced.

In order to do that, we can edit the wp-config.php file inside our WordPress directory and insert the following lines:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

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).

Relevant Documentation:
https://codex.wordpress.org/Debugging_in_WordPress

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

Last updated by kevinD-38 1 year, 7 months ago.

Assisted by: Mihai Apetrei.

Author Posts
August 29, 2023 at 6:09 pm #14308489

marthaZ

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.

Screenshot at Aug 29 14-07-36.png
August 29, 2023 at 6:10 pm #14308513

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

Before your ticket is assigned to one of my colleagues, I will try to help.

Can you please enable the WordPress debug log and recreate the issue to see if you are getting a longer error message that is more specific?

This will allow us to see if any PHP errors are being produced.

More Info: https://codex.wordpress.org/Debugging_in_WordPress

In order to do that, edit the wp-config.php file inside your WordPress directory and insert the following lines:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Now please reproduce the issue once again.

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 here with us (only you and us will see the URL you are sharing).

We will be waiting for your response.

Kind regards,
Mihai Apetrei

August 29, 2023 at 6:13 pm #14308521

marthaZ

Thanks, Mihai, done.

August 29, 2023 at 6:16 pm #14308527

marthaZ

I have reproduced the issue but I can’t even find the debug.log within content

August 29, 2023 at 6:23 pm #14308531

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Then, let's try this instead:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', true );

Now please reproduce the issue once again. Hopefully, you should see a more detailed error message on screen now instead of just that general one.

August 29, 2023 at 6:26 pm #14308533

marthaZ

Mihai, got it, I placed the code on the wrong place: hidden link

August 29, 2023 at 6:32 pm #14308627

marthaZ

Mahai, for whatever is worth, the only pages with broken links are the Home Pages in English and Spanish, the rest of languages are fine.

Here are the URL’s for the different sites:
hidden link
hidden link
hidden link
hidden link

August 29, 2023 at 6:35 pm #14308629

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Great that you were able to add the debug information.

It seems that the fatal error comes from the plugin "Media Library Organizer" not from WPML.

If you disable it, maybe things will start working?

Please let us know how things go.

Mihai

August 29, 2023 at 6:44 pm #14308779

marthaZ

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.

Screenshot at Aug 29 14-41-41.png
Screenshot at Aug 29 14-07-36.png
August 29, 2023 at 6:48 pm #14308825

marthaZ

Please disregard this 🙁 it was a message about the Media Organizer that I thought had something to do with WPML

August 29, 2023 at 7:26 pm #14308973

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there and thank you for the update.

Can you please mark this ticket as resolved if the issue has been resolved?

Thank you! 🙂

Mihai

August 29, 2023 at 8:04 pm #14309029
marthaZ

Mihai, I have managed to fix the link that got broken but I still can’t get the Menu Language Switcher, so it’s not solved.

New threads created by Mihai Apetrei and linked to this one are listed below:

https://wpml.org/forums/topic/split-cant-get-the-menu-language-switcher/

August 29, 2023 at 8:29 pm #14309103

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Sorry.

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


- Can you install this WPML beta version 4.6.6-b.1:
https://wpml.org/download/wpml-multilingual-cms/?section=changelog

Please let us know how things go.

Mihai

August 29, 2023 at 8:33 pm #14309113

marthaZ

I can do that, but it was working until this morning without an issue

August 29, 2023 at 8:33 pm #14309115

marthaZ

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

could that be the problem?