[BUGFIX] Make single errors from FileSizeValidator translatable 96/58996/4
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Thu, 29 Nov 2018 21:54:35 +0000 (22:54 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 11 Jan 2019 13:11:54 +0000 (14:11 +0100)
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>
Build/Scripts/duplicateExceptionCodeCheck.sh
typo3/sysext/form/Classes/Mvc/Property/TypeConverter/UploadedFileReferenceConverter.php

index 66ea79e..aa4d00c 100755 (executable)
@@ -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=""
@@ -84,4 +85,4 @@ do
     fi
 done || exit 1
 
-exit 0
\ No newline at end of file
+exit 0
index df4a1ec..59ad2e4 100644 (file)
@@ -209,7 +209,7 @@ class UploadedFileReferenceConverter extends AbstractTypeConverter
                     $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());
                     }
                 }
             }