[FLOW3-general] Weight / compound error messages
Adrian Föder
adrian at foeder.de
Tue May 8 17:45:46 CEST 2012
Hi again,
again a general issue, happening on a concrete use case of mine that'll
explain what I mean.
I want to validate an image upload, it's annotated with two validators:
* @FLOW3\Validate([...]SizeValidator, options={ "minimumWidth"=180,
"minimumHeight"=180 })
* @FLOW3\Validate([...]TypeValidator, options={
"allowedTypes"={"jpeg","png","gif"} })
When uploading a text file for example, I satisfyingly get the following
errors:
1319801362: The actual image width of 0 is lower than the allowed
minimum width of 180.
1319801925: The actual image height of 0 is lower than the allowed
minimum height of 180.
1328030664: The uploaded file is no valid image.
That's fine, but you could imaging that I want to have kind of two
stages of validation, first stage would affect >>1328030664: The
uploaded file is no valid image.<<, next stage would affect the
remaining errors.
Is there already something in planning that accommodates that? For a
pretty simple solution it would even be sufficient to allow setting up
the ViewHelper to show only e.g. one error at a stage, with a specific
sort order, maybe
<f:form.validationResults
for="newImage"
errorCodeOrder="1328030664,1319801362,1319801925"
errorLimit="1"
/>
(of course just a draft), or, just coming into mind,
<f:form.validationResults
for="newImage"
occurrenceCompilation="[1328030664],[1319801362,1319801925]"
/>
Your thoughts?
Best,
Adrian
More information about the FLOW3-general
mailing list