Skip Navigation

[Resolved] Error: Missing format specifier at end of string upon upgrading to php8

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 8 replies, has 2 voices.

Last updated by Minesh 11 months, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2672343

Tell us what you are trying to do?
Site was recently updated to PHP8, but when loading my site in zh-hans language, i get this error:

Fatal error: Uncaught ValueError: Missing format specifier at end of string in /public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/custom-taxonomies.php:209
Stack trace:
#0 /public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/custom-taxonomies.php(209): sprintf('\xE6\x90\x9C\xE7\xB4\xA2 %', 'Product Categor...')
#1 /public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/custom-taxonomies.php(68): wpcf_custom_taxonomies_register('product-cat', Array)
#2 /public_html/wp-content/plugins/types/vendor/toolset/types/embedded/functions.php(109): wpcf_custom_taxonomies_init()
#3 /public_html/wp-includes/class-wp-hook.php(307): wpcf_init_custom_types_taxonomies('')
#4 /public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#5 /public_html/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /public_html/wp-settings.php(598): do_action('init')
#7 /public_html/wp-config.php(120): require_once('/public_html/wp-set...')
#8 /public_html/wp-load.php(50): require_once('/public_html/wp-con...')
#9 /public_html/wp-blog-header.php(13): require_once('/public_html/wp-loa...')
#10 /public_html/index.php(17): require('/public_html/wp-blo...')
#11 {main} thrown in /public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/custom-taxonomies.php on line 209

I found that if i disabled the String Translation plugin, the error goes away. But i would like to fix this the right way and still use string translation.

Similar issues i found: https://toolset.com/forums/topic/fatal-error-unknown-format-specifier-s-with-types-and-php8/

How do i determine which string is problematic and manually fix in the db?

#2672523

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I will require duplicator copy of your site to know where the problem is located.

Can you please send me duplicator copy of your site or you can setup a test site where can I access the site without any issue so you may have to setup that test site with PHP 7.x.x version.

Can you please tell me what option you would like to prefer?

#2672529

I can provide you a test environment

#2672533

Minesh
Supporter

Languages: English (English )

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

ok please share test environment and share the link where the issue happens with PHP8.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2672617

Minesh
Supporter

Languages: English (English )

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

Can you please tell me where on what page I can see the issue?

In addition to that I would like to know - did you change the slug of your "Product Categories" taxonomy?

#2672687

Hi, you can see the issue as soon as you change to the Chinese (zh-hans language) on the front-end country selector at the top of the page navigation. Also, im not sure on if the category slug was changed, i do not think so, but can be wrong.

#2672899

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've removed the %s from the string translation for your Chinese (zh-hans language) for the string "Search %s":
- hidden link

Can you please confirm it works as expected.

#2672905

Thank you! I think that worked. But can you let me know how to knew how to find that particular string that is problemactic? I think it'll help others if they know your steps in finding this issue--as this appears to only happen after upgrading to a php8 server.

#2672909

Minesh
Supporter

Languages: English (English )

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

Ok - it was issue with %s that replaces with % when you translate it. So I removed the %s from the string translation for those specific string of Chinese translation and I see its working.

Can you please confirm the string displays as expected. I believe the problematic string here will be used in backend.