Skip Navigation

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

Problem:
Error: PHP Fatal error: Uncaught ValueError: Unknown format specifier "" in ...
Solution:
- Edit the file and line number that is mentioned in the error message.
- Copy the string then search this string in String Translation.
- Try to fix this, keep the same placeholder, such as %s, in the translation.
Relevant Documentation:
https://wpml.org/errata/php-8-php-fatal-error-uncaught-valueerror-unknown-format-specifier-in/
https://translate.wordpress.com/placeholders-and-tags/

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

Last updated by veetiP 1 year, 10 months ago.

Assisted by: Long Nguyen.

Author Posts
March 10, 2023 at 1:33 pm #13217947

veetiP

Hello, hope you’re doing well.

I have had a critical error on my Blocksy theme customizer since I changed the default language from English to Finnish on my website.

It has to do something with the website strings and I’m not sure what it could be. I also use a directory for the default language which might cause a problem as well.

I can create an admin account to check out the problem. Thank you in advance.

WP Error.PNG
March 10, 2023 at 4:29 pm #13219491

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thank you for contacting the support forum.
Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

The error is because of an invalid translation either coming from MO file or added by the translator to WPML.
Please see this errata https://wpml.org/errata/php-8-php-fatal-error-uncaught-valueerror-unknown-format-specifier-in/

To fix this issue, you can go the to file and line number that is mentioned in the error message and copy the string. You can then search this string in String Translation and try to fix it as per the errata.

Please try it and let us know.

Thanks

March 11, 2023 at 11:13 am #13222777

veetiP

Hey Sumit.

Thank you for the quick reply. I tried to to do the provided steps but did not quite figure the problem out. I'd appreciate some additional help for the issue.

Sorry for the inconvenience.

March 13, 2023 at 7:34 am #13228493

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi there,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

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. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: 
https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.

While checking the debug info, I see that the WordPress Memory Limit is below the requirements. The minimum requirements are 128M, but we do recommend 256M and the debug information of your site shows it set to 40M. Please check this link for more details
https://wpml.org/home/minimum-requirements/.
You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:


define( 'WP_MAX_MEMORY_LIMIT', '256M' );
define( 'WP_MEMORY_LIMIT', '128M' );

After adding the code you can confirm that the memory was changed correctly from WPML > Support > WordPress > Memory limit.

Look forward to your reply.
Thanks

March 13, 2023 at 9:39 am #13229707

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Thank you for your feedback.

There are some placeholders "%s" that should be kept the same in the translation but somehow they are incorrect on your site and I've fixed that issue by following the documentation https://wpml.org/errata/php-8-php-fatal-error-uncaught-valueerror-unknown-format-specifier-in/

Please check these screenshots
hidden link
hidden link

they should be "%sinstructions%s" and "%shere%s". Please read more on WordPress documentation hidden link

Now you can see the customizer works as well.

Look forward to your reply.
Thanks

March 13, 2023 at 10:15 am #13230149

veetiP

Hi,

The problem is now fixed. Thank you for your expertise!