 dominikS-33
|
Background of the issue:
I am trying to update my PHP version to 8.0 or higher, as recommended by WordPress, but encounter issues when changing the language on my website from English to German.
Symptoms:
A critical error occurs when I change the language on my website from English to German after updating PHP to version 8.0 or higher. The error disappears when reverting to PHP 7.x.
Questions:
Why does a critical error occur when changing the language after updating PHP to 8.x?
How can I resolve the critical error related to PHP version changes?
|
 Noman
WPML Supporter since 06/2016
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
To further debug this issue, please provide FTP Login info to your site, so that I can look into your setup and debug the issue.
Your next answer will be private, meaning only you and I can access it.
=== Please backup your database and website ===
✙ I would need your permission to deactivate and reactivate Plugins and the Theme and to change configurations on the site. This is also a reason the backup is essential.
Thank you
|
 dominikS-33
|
Hello, how can we solve the issue?
|
 Waqas Bin Hasan
WPML Supporter since 05/2014
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Hi,
Reference to our chat https://wpml.org/forums/topic/cirital-error-when-changing-to-php-8-x-2/ about this very issue, I've set your next reply as private to provide the detail securely, as asked by my colleague.
Regards.
|
 dominikS-33
|
Since you are not responding within a reasonable timeframe, I have reverted the PHP version back to 7.4. An error on this live e-commerce website is unacceptable. If at any point you need PHP 8.2 again for your analysis, please let me know. In that case, we will need to coordinate the timing so that the switch is only temporary, as it causes an error on the live site.
|
 Noman
WPML Supporter since 06/2016
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
To further debug this issue without affecting your live site, I have set up a fresh WP site on a test server(cloudways) with PHP 8.2. Please migrate your site to our test server and let me know once the migration process completes.
I shared the migration details in my previous private reply.
Thank you for your cooperation
|
 dominikS-33
|
I have done the migration.
|
 Noman
WPML Supporter since 06/2016
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Thanks for migrating the site. I followed the below steps on test site:
1. Access the wp-content/languages/wpml directory using FTP.
2. Deleted the damaged “woocommerce-de_DE.mo” file and the issue is gone as you can see here: hidden link
Could you please take a backup of your site and try to follow the same steps on your site and see if this resolves the issue.
Here is errata for more details:
https://wpml.org/errata/php-8-php-fatal-error-uncaught-valueerror-unknown-format-specifier-in/
Thank you for your cooperation
|
 dominikS-33
|
Thank you, it seems that this solved the issue. Two questions:
1) What are the consequences of deleting the language file woocommerce-de_DE.mo? Are translations lost as a result? Do I have to retranslate anything?
2) I saw that several files with the ending “*de_DE.l10n.php” were created in the wpml folder the day before yesterday. Did you create them? Can I delete them?
|
 dominikS-33
|
This solution did not work for long. After deleting the file woocommerce-de_DE.mo, I noticed some German translations in WooCommerce are missing. For example I translated this string
"Pay via PayPal; you can pay with your credit card if you don't have a PayPal account."
to
"Mit Paypal bezahlen. Sollten Sie keinen Paypal-Account besitzen, können Sie auch mit Ihrer Kreditkarte bezahlen."
The issue immediately appeared again. It's not a solution if I can't translate the require content.
|
 Noman
WPML Supporter since 06/2016
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Sorry you’re still having issues. I found the problematic string causing this error. Please follow these steps:
1. Go to WPML >> String Translation.
2. Search for the “All %s” string.
3. Select the WooCommerce domain and enable “Exact match” option as you can see in the attached screenshot.
4. Update the German translation from:
To:
This should resolve the issue. Could you please check and confirm?
Thank you for your cooperation and patience
|
 dominikS-33
|
Thank you, this solved the issue.
|