Skip to content

Commit

Permalink
[BUGFIX] Make single errors from FileSizeValidator translatable
Browse files Browse the repository at this point in the history
Hand over the original error code from the validator instead of
setting a new one.

Resolves: #87042
Releases: master, 9.5
Change-Id: Ifbb023423934832fdea2550aa7d3a55507616e73
Reviewed-on: https://review.typo3.org/58996
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
  • Loading branch information
Mabahe authored and maddy2101 committed Jan 11, 2019
1 parent ad4f700 commit b5903a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Build/Scripts/duplicateExceptionCodeCheck.sh
Expand Up @@ -17,6 +17,7 @@ ignoreFiles+="sysext/core/Tests/Acceptance/Support/_generated/BackendTesterActio
ignoreFiles+="sysext/core/Tests/Acceptance/Support/_generated/InstallTesterActions.php"
# a exception in here throws up an code from a previous exception
ignoreFiles+="sysext/extbase/Classes/Core/Bootstrap.php"
ignoreFiles+="sysext/form/Classes/Mvc/Property/TypeConverter/UploadedFileReferenceConverter.php"

foundNewFile=0
oldFilename=""
Expand Down Expand Up @@ -84,4 +85,4 @@ do
fi
done || exit 1

exit 0
exit 0
Expand Up @@ -209,7 +209,7 @@ protected function importUploadedResource(
$validationResult = $validator->validate($uploadedFile);
if ($validationResult->hasErrors()) {
$uploadedFile->getStorage()->deleteFile($uploadedFile);
throw new TypeConverterException($validationResult->getErrors()[0]->getMessage(), 1471708999);
throw new TypeConverterException($validationResult->getErrors()[0]->getMessage(), $validationResult->getErrors()[0]->getCode());
}
}
}
Expand Down

0 comments on commit b5903a0

Please sign in to comment.