-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
@@ -50,7 +50,7 @@ class File extends Constraint | |||
public $uploadFormSizeErrorMessage = 'The file is too large.'; | |||
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'. |
@@ -192,7 +192,7 @@ | |||
</trans-unit> | |||
<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. |
…p_dir (Breuls) This PR was merged into the 2.7 branch. Discussion ---------- [Validator] Improved error message for missing upload_tmp_dir | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A 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](http://php.net/manual/en/features.file-upload.errors.php): > UPLOAD_ERR_NO_TMP_DIR > Value: 6; Missing a temporary folder. Introduced in PHP 5.0.3. '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. Commits ------- afbf227 [Validator] Improved error message for missing upload_tmp_dir
…alidation secti… (davewwww) This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] add "mapping" configuration key at validation secti… | Q | A | | --- | --- | | Bug fix? | no | | New feature? | yes | | BC breaks? | no | | Deprecations? | no | | Tests pass? | yes | | Fixed tickets | #15655 | | License | MIT | | Doc PR | symfony/symfony-docs#7407 | This feature allows you, to define additional validation files or directories which are not in the 'Bundle*/Resources/config/' directory. ``` yaml #config.yml framework: validation: mapping: paths: - "path/to/file/validation.yml" - "path/to/file/validation.xml" - "path/to/another/directory" ``` Commits ------- d696cfb [FrameworkBundle] Configurable paths for validation files 60d7d43 fix merge 61475b5 Merge branch '3.2' ba41e70 Merge branch '3.1' into 3.2 4268aba Merge branch '2.8' into 3.1 3faf655 Merge branch '2.7' into 2.8 e95fc09 fix getMock usage 482828c fix merge ed5eb6d bug #21372 [DependencyInjection] Fixed variadic method parameter in autowired classes (brainexe) a7f63de [DependencyInjection] Fixed variadic method parameter in autowired classes 9ef4271 minor #21371 [Validator] update German translation (xabbuh) f920e61 update German translation 41c72ab minor #21335 [Validator] Improved error message for missing upload_tmp_dir (Breuls) afbf227 [Validator] Improved error message for missing upload_tmp_dir
Also adjusted trans-unit "51" to commit symfony#21335
Also adjusted trans-unit "51" to commit #21335
…on (mweimerskirch) This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes #24719). Discussion ---------- Fixed a few spelling mistakes in Luxembourgish translation Fixed a few spelling mistakes in Luxembourgish translation and also adjusted trans-unit "51" to commit #21335 | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? |no | Tests pass? | yes | License | MIT Commits ------- 7a81576 Fixed a few spelling mistakes in Luxembourgish translation
…gusz) This PR was squashed before being merged into the 3.4 branch. Discussion ---------- [Validator] Remove commas in translations | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | License | MIT These translations were originally modified in #21335. Commits ------- 5688f97 [Validator] Remove commas in translations
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.