Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong translation string format causes fatal error with PHP 8.1 #7330

Open
proteo opened this issue Jul 20, 2024 · 0 comments
Open

Wrong translation string format causes fatal error with PHP 8.1 #7330

proteo opened this issue Jul 20, 2024 · 0 comments

Comments

@proteo
Copy link

proteo commented Jul 20, 2024

Description

After upgrading a client's website to PHP 8.1 this error appears in the screen when accessing a Portuguese (pt-pt) translated page:

Fatal error: Uncaught ValueError: Missing format specifier at end of string in /var/www/html/wp-content/plugins/pods/classes/PodsInit.php on line 2006
ValueError: Missing format specifier at end of string in /var/www/html/wp-content/plugins/pods/classes/PodsInit.php on line 2006

After the call stack list, PHP displays the last function call which reveals the the cause of the error: the translation string is missing the "s" after the % symbol:

[sprintf](http://www.php.net/function.sprintf)( $format = 'Todos os %', $values = 'Pod Templates' )

Version

3.2.4

Testing Instructions

No response

Screenshots / Screencast

Screenshot 2024-07-20 at 11 22 25 a m

Possible Workaround

The error can be fixed by downloading the /wp-content/languages/plugins/pods-pt_PT.po and associated .mo files and manually edit it (in my case using POEdit) to change the line 918 from:

msgstr "Todos os %"

to:

msgstr "Todos os %s"

Then uploading the file again.

Site Health Information

No response

Pods Package

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant