DateTimeConverter should return Error objects for user-errors; and support converting an empty string to NULL
Returning Error objects¶
The TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter should return an \TYPO3\FLOW3\Error\Error instead of throwing an \TYPO3\FLOW3\Property\Exception\TypeConverterException.
The advantage of this change is the much better handling of form convertion/validation error messages. The messages are stored as "validationResults" in $this->arguments of the current ActionController.
Displaying the messages could be easily done with the Fluid ViewHelper f:form.validationResults.
Support "empty" DateTime -> Convert to NULL¶
Right now, the DateTimeConverter is required, i.e. it is not possible to define an optional DateTime object.
When the DateTime converter returns NULL for the empty string, one can use "@validate NotEmpty" for required properties.
Updated by Sebastian Kurfuerst about 10 years ago
- Subject changed from DateTimeConverter should return an Error instead of throwing Exceptions to DateTimeConverter should return Error objects for user-errors; and support converting an empty string to NULL
sorry for hijacking the description; I extended it a bit - and will work on a fix now.