-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Validator] Improved error message for missing upload_tmp_dir #21335
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
| public $uploadPartialErrorMessage = 'The file was only partially uploaded.'; | ||
| public $uploadNoFileErrorMessage = 'No file was uploaded.'; | ||
| public $uploadNoTmpDirErrorMessage = 'No temporary folder was configured in php.ini.'; | ||
| public $uploadNoTmpDirErrorMessage = 'No temporary folder was configured in php.ini, or the configured folder does not exist.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay the same. If we made the change here, this would be a BC break for everyone using their own translations. Instead, we can just change the target value in the validators.en.xml file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't know that was a possibility.
I've updated the PR; only the language files for EN, NL and PL now have the change.
|
👍 |
|
Current: Proposal: Not 100% sure about the original text. It's not wrong, but it feels a bit like google translate. |
|
@iltar 'folder' isn't actually a Dutch word, so it seems odd to change 'map' to 'folder'. |
| <trans-unit id="51"> | ||
| <source>No temporary folder was configured in php.ini.</source> | ||
| <target>Nie skonfigurowano folderu tymczasowego w php.ini.</target> | ||
| <target>Nie skonfigurowano folderu tymczasowego w php.ini, lub folder konfiguracji nie istnieje.</target> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nie skonfigurowano folderu tymczasowego w php.ini, lub skonfigurowany folder nie istnieje.
|
After a small discussion on slack in
|
|
Allright, that's fine. I'll make it "gespecificeerde" though, as "gespecifiëerde" also doesn't exist. ;) |
|
@fabpot Sorry, missed that. I didn't write the original proposal, but I've updated it now. |
|
👍 |
|
Thank you @Breuls. |
I ran into a problem in which the value for upload_tmp_dir was set in php.ini, but PHP was unable to write to the specified location. PHP returns an UPLOAD_ERR_NO_TMP_DIR in $_FILES when it can't find or use the tmp dir, and my application displayed the error for $uploadNoTmpDirErrorMessage, from which I drew the conclusion that the ini setting was missing or emtpy.
This conclusion was based on the wording in the error message, which explicitly states that 'no temporary folder was configured', which is not actually correct. According to the PHP documentation:
'Missing' might be interpreted as 'the value for the ini setting is missing', but also as 'the configured folder is missing'.
I thought it might save someone some time if the error message from the Symfony Validator makes this explicit, which is what this PR aims to do.
I also updated the Dutch and Polish translations, because those, in addition to English, are the languages spoken in my team.