Bug #88022
closedArguments not passed or replaced in FileSize validator error message
100%
Description
Description:¶
FileSize validation message shows with placeholders untouched, like so:You must select a file that is larger than %s in size.
How to reproduce:¶
- Create a form with a file input field and add the FileSize validator to it.
- Submit form with file which does not pass file size validation.
Potential cause:¶
Validation rules for file uploads are handled differently than with other fields as they are called in typo3/sysext/form/Classes/Mvc/Property/TypeConverter/UploadedFileReferenceConverter.php
in the method importUploadedResource
to prevent file uploads which do not pass validation.
If a validation fails, the method throws a TypeConverterException
which is caught and returned as a new error in this part of importUploadedResource->convertFrom
:
try { $resource = $this->importUploadedResource($source, $configuration); } catch (\Exception $e) { return $this->objectManager->get(Error::class, $e->getMessage(), $e->getCode()); }
First thing I noticed is that the error instance is of the class \TYPO3\CMS\Extbase\Error\Error
and not \TYPO3\CMS\Extbase\Validation\Error
like the errors for all other fields. I do not know if this poses a problem.
Second, the error is instantiated using only the error message and code, which means all values which should be passed to the "arguments" property of the error instance are lost, hence the untouched "%s" parts of the error string.
Updated by Jarvis H over 5 years ago
- Related to Bug #87042: Single errors from FileSizeValidator could not be translated added
Updated by Jarvis H over 5 years ago
- Priority changed from Should have to Must have
Updated by Gerrit Code Review over 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60549
Updated by Gerrit Code Review over 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60591
Updated by Michael Waack over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 610aeca61a02b01dc2231b83d912ea5a8929cc80.