Issue Bug Closed

#89684PropertyMapper will throw exception on validating classes without a constructor

Christian Eßl 11/14/19, 14:38 updated 01/13/20, 20:07

Description

If DTO class is used in a form, that has no constructor (and does not inherit from “AbstractEntity”) and a property is missing (because the developer forgot to add it to the class), the property mapper will not show meaningfull errors about the property but instead throw the following exception:

#1297759968: Exception while property mapping at property path “”: Method Cyberhouse\ExtensionName\Domain\Dto\TestForm::__construct() does not exist

In case a property is missing, the PropertyMapper automatically expects the class to have a constructor when handling the error. If all properties are present in the class, everything works fine without a constructor (submitting forms, validating, etc.), so I will treat this as a bug in the PropertyMapper.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.