Tags: nette/forms
Tags
Helpers::tryEnumConversion() no longer throws on incompatible input Mapping a text/hidden control to a backed-enum property fed BackedEnum::from() the raw submitted value; an int-backed enum with a non-numeric string (e.g. an empty field) raised TypeError, and any out-of-range value raised ValueError - HTTP 500. Convert only when the value matches the enum backing type, using tryFrom(), and leave the value unchanged otherwise.
PreviousNext