-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: error translating quantity value unit without abbreviation #18321
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
Conversation
Review Checklist
|
Note that #18313 wants to change the same line. |
Pimcore\Translation\Translator::trans(): Argument #1 ($id) must be of type string, null given Fixed by adding a condition to check whether abbreviation is null and using the untranslated ID instead.
|
@kjkooistra-youwe I am not able to save a unit with null in abbreviation. For me the abbreviation is always an empty string, even when I export it, write null as value and import it. Could you please provide more information? Thanks |
@robertSt7 The units were created by an import via the PHP API. If the abbreviation is not set there it's null. I updated the initial comment to clarify this.
|
@kjkooistra-youwe Thanks for fixing this null error |
Pimcore\Translation\Translator::trans(): Argument #1 ($id) must be of type string, null given
Fixed by adding a condition to check whether abbreviation is null and using the untranslated ID instead.
To reproduce, set a quantity value with a unit without an abbreviation. This unit would be created via the PHP API.
Encountered this error in the messenger failed queue of an import because it creates units for use in the Pimcore, but it doesn't provide any additional details (like abbreviation).