-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Can't add items to invoice unter PHP8.0 and 8.1 #23339
Comments
V16 doesn't support fully PHP8. Try with PHP 7.4 OR look at your Dolibarr log and post the error here. |
Hello, Could you send us the error.log from Apache ? |
stderr: PHP Fatal error: Uncaught ValueError: Missing format specifier at end of string in /core/class/translate.class.php:641 |
Same here. I'm Swiss German and found the source of the problem: "ReductionShort" and "ReductionsShort" ist not translated and contains an "%" Swiss German: "ReductionShort" and "ReductionsShort" must be "Rabatt" dolibarr/htdocs/langs/de_CH/bills.lang Line 122 in e76641c
dolibarr/htdocs/langs/de_CH/bills.lang Line 124 in e76641c
German: dolibarr/htdocs/langs/de_DE/bills.lang Line 306 in e76641c
dolibarr/htdocs/langs/de_DE/bills.lang Line 308 in e76641c
Workaround: |
This should be fixed in Transifex, not directly in source code. |
Had the same issue under Dolibarr 17.0.3 after switching to PHP 8.x |
The problem is not that the string is not translated correctly. The current translation "%" (Prozent) is a perfectly valid short translation of the word Rabatt. The problem is that Dolibarr can't handle a string when it contains a single %. This should not be fixed in Transifex, it should be handled correctly in translate.class.php. (In PHP7 sprintf() returned false when a error occured. In PHP8 it returns a ValueError. Hence the different behavior.) |
Bug
I setup a new instance of Dolibarr 16.0 and tried to create an invoice.
The part to add positions doesn't appear for some reason.
If I switch to PHP7.4 it works fine.
I had the same issue on a long running Dolibarr 14.0.5.
Environment Version
16.0.3 & 14.0.5
Environment OS
freeBSD
Environment Web server
Apache
Environment PHP
8.0 & 8.1
Environment Database
MariaDB
Environment URL(s)
No response
Expected and actual behavior
No response
Steps to reproduce the behavior
No response
Attached files
No response
The text was updated successfully, but these errors were encountered: