Background of the issue:
I am trying to translate my website using WPML. When I go to WPML Translation Management, I encounter a critical error. The error message indicates that WordPress detected a fatal error with the WPML String Translation plugin. I am using WordPress version 6.7.2, the Aldlalz theme version 3.4.7, and PHP version 8.2.27. The error details mention an uncaught TypeError in the file /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/Setting/Repository/SettingsRepository.php at line 245.
Symptoms:
An error of type E_ERROR was caused in line 245 of the file /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/Setting/Repository/SettingsRepository.php. Error message: Uncaught TypeError: WPMLStringTranslationInfrastructureSettingRepositorySettingsRepository::getDefaultLanguageLocaleCode(): Return value must be of type string, null returned.
Questions:
How can I resolve the critical error with the WPML String Translation plugin?
What steps should I take to fix the TypeError in the SettingsRepository.php file?
WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, WPML String Translation.
First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.
hidden link
To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.7.2
Active theme: Aldlalz (version 3.4.7)
Current plugin: WPML String Translation (version 3.3.2)
PHP version 8.2.27
Error Details
=============
An error of type E_ERROR was caused in line 245 of the file /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/Setting/Repository/SettingsRepository.php. Error message: Uncaught TypeError: WPML\StringTranslation\Infrastructure\Setting\Repository\SettingsRepository::getDefaultLanguageLocaleCode(): Return value must be of type string, null returned in /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/Setting/Repository/SettingsRepository.php:245
Stack trace:
#0 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/StringCore/Repository/TranslationsRepository.php(82): WPML\StringTranslation\Infrastructure\Setting\Repository\SettingsRepository->getDefaultLanguageLocaleCode()
#1 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/StringCore/Command/LoadExistingStringTranslationsCommand.php(42): WPML\StringTranslation\Infrastructure\StringCore\Repository\TranslationsRepository->createEntitiesForExistingTranslations()
#2 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/StringGettext/Command/ProcessPendingStringsCommand.php(135): WPML\StringTranslation\Infrastructure\StringCore\Command\LoadExistingStringTranslationsCommand->run()
#3 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Application/StringGettext/Service/GettextStringsService.php(179): WPML\StringTranslation\Infrastructure\StringGettext\Command\ProcessPendingStringsCommand->run()
#4 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Application/StringCore/Service/StringsService.php(23): WPML\StringTranslation\Application\StringGettext\Service\GettextStringsService->processSavedPendingStringsAndSettingsQueue()
#5 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/WordPress/HookHandler/InitAction.php(66): WPML\StringTranslation\Application\StringCore\Service\StringsService->maybeProcessQueue()
#6 /home/u833106985/domains/aldlalz.com/public_html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/WordPress/HookHandler/AbstractActionHookHandler.php(14): WPML\StringTranslation\Infrastructure\WordPress\HookHandler\InitAction->onAction()
#7 /home/u833106985/domains/aldlalz.com/public_html/wp-includes/class-wp-hook.php(322): WPML\StringTranslation\Infrastructure\WordPress\HookHandler\AbstractActionHookHandler->WPML\StringTranslation\Infrastructure\WordPress\HookHandler\{closure}()
#8 /home/u833106985/domains/aldlalz.com/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#9 /home/u833106985/domains/aldlalz.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#10 /home/u833106985/domains/aldlalz.com/public_html/wp-settings.php(704): do_action()
#11 /home/u833106985/domains/aldlalz.com/public_html/wp-config.php(107): require_once('/home/u83310698...')
#12 /home/u833106985/domains/aldlalz.com/public_html/wp-load.php(50): require_once('/home/u83310698...')
#13 /home/u833106985/domains/aldlalz.com/public_html/wp-admin/admin.php(34): require_once('/home/u83310698...')
#14 {main}
thrown
To ensure the quickest and most accurate support, please provide your debug information so I can look at some of your configurations. We have an excellent article on how to locate it here: https://wpml.org/faq/provide-debug-information-faster-support/.
Our devs are taking a look, and it may be helpful to take a look at your site (if that's not a problem for you).
If it's ok, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue.
It would be better to a testing site where the issue is replicated.
The information you will enter is private which means only you and I can see and have access to it.
Maybe I'll need to replicate your site locally. For this, I'll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site.
This will allow me to create a copy of your site and your content.
Once the problem is resolved I will delete the local site.
**IMPORTANT**
- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields.
Otto I think somehow i managed to make it works, but menu and some content images not showing i don't know where the problem is can you assist? I uploaded some of the issue i am facing
New threads created by Otto and linked to this one are listed below: