Skip Navigation

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

Problem:
The client was experiencing a fatal error when trying to install WPML String Translation on their WordPress site. The error message indicated an undefined method call to

WP_Textdomain_Registry::reset()

.

Solution:
We recommended that the client should upgrade the WPML String Translation plugin to version 3.2.3 or greater, as this version is required for WordPress version 6.1 or higher. Before upgrading, it is crucial to perform a full site backup. After the backup, the client should update the plugin and check if the issue persists. For more details on the upgrade process and the importance of compatibility with WordPress 6.1, the client can refer to our documentation:

If this solution does not resolve the issue, we encourage the client to open a new support ticket with us for further assistance.

0% of people find this useful.

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

Last updated by Bigul 1 year, 3 months ago.

Assisted by: Bigul.

Author Posts
January 12, 2024 at 10:54 am #15178443

gianpieroD

I am trying to:
Install WPML String Translation

Link to a page where the issue can be seen:
hidden link

I expected to see:
working site

Instead, I got:
Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in /home/lagattac/public_html/wp-content/plugins/wpml-string-translation.old/classes/MO/Hooks/LanguageSwitch.php:139 Stack trace: #0 /home/lagattac/public_html/wp-content/plugins/wpml-string-translation.old/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation() #1 /home/lagattac/public_html/wp-content/plugins/wpml-string-translation.old/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects() #2 /home/lagattac/public_html/wp-content/plugins/wpml-string-translation.old/classes/MO/Hooks/LanguageSwitch.php(48): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale() #3 /home/lagattac/public_html/wp-includes/class-wp-hook.php(326): WPML\ST\MO\Hooks\LanguageSwitch->languageHasSwitched() #4 /home/lagattac/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /home/lagattac/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #6 /home/lagattac/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1180): do_action() #7 /home/lagattac/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(2919): SitePress->switch_lang() #8 /home/lagattac/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-browser-redirect.php(35): SitePress->get_ls_languages() #9 /home/lagattac/public_html/wp-includes/class-wp-hook.php(324): WPML_Browser_Redirect->enqueue_scripts() #10 /home/lagattac/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #11 /home/lagattac/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #12 /home/lagattac/public_html/wp-includes/script-loader.php(2262): do_action() #13 /home/lagattac/public_html/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts() #14 /home/lagattac/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #15 /home/lagattac/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #16 /home/lagattac/public_html/wp-includes/general-template.php(3052): do_action() #17 /home/lagattac/public_html/wp-content/themes/stockholm/header.php(13): wp_head() #18 /home/lagattac/public_html/wp-includes/template.php(790): require_once('/home/lagattac/...') #19 /home/lagattac/public_html/wp-includes/template.php(725): load_template() #20 /home/lagattac/public_html/wp-includes/general-template.php(48): locate_template() #21 /home/lagattac/public_html/wp-content/themes/stockholm/full_width.php(6): get_header() #22 /home/lagattac/public_html/wp-includes/template-loader.php(106): include('/home/lagattac/...') #23 /home/lagattac/public_html/wp-blog-header.php(19): require_once('/home/lagattac/...') #24 /home/lagattac/public_html/index.php(17): require('/home/lagattac/...') #25 {main} thrown in /home/lagattac/public_html/wp-content/plugins/wpml-string-translation.old/classes/MO/Hooks/LanguageSwitch.php on line 139

These are the debug info:
[removed]

I have deactivated the plugin for now. This issue also occurs on another website that is using the same theme hidden link

January 12, 2024 at 11:38 am #15178702

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

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

Hi there.

Before this ticket gets assigned to my colleagues, I will try to help.

1. Can you please let me know which String Translation version you are trying to install (the latest one is 3.2.9)?

2. This issue looks to me like it could also caused by server-related reasons 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 can 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.

I will be waiting for your response.

Kind regards,
Mihai Apetrei

January 19, 2024 at 9:06 am #15203493

gianpieroD

Hi Mihai, the version of the string trans. plugin is 3.2.1
I can confirm the error occurs also when all plugin except WPML are deactivated

January 20, 2024 at 1:36 am #15206753

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback. It looks like this bug is related to the following ticket.

https://wpml.org/forums/topic/fatal-error-uncaught-error-call-to-undefined-method-wp_textdomain_registry/

String Translation 3.2.3 version or greater is mandatory when we are using WordPress version 6.1 or greater. So please upgrade the WPML String Translation plugin to version 3.2.9 after a full site backup{mandatory} and make sure the bug exists or not.

Please refer to the following article for more details and let us know your feedback.

https://wpml.org/changelog/2022/10/wpml-4-5-12-updates-for-wordpress-6-1/

--
Thanks!

Bigul