Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic conversion enum/int - when mapping to class #337

Closed
wants to merge 20 commits into from

Conversation

mildabre
Copy link
Contributor

@mildabre mildabre commented Aug 3, 2024

Nette forms doesnt support data type Enum when mapping form values to class. This makes problems when using forms with mapping values to class - see error reported here: https://forum.nette.org/cs/36594-prevod-vybraneho-optionu-v-selectu-na-enum-type

In some cases might be useful also automatic conversion of string value to int - if data type int is defined in some property in data class and form control supplies string.

The proposed change of the code isnt complicated and makes no BC break. The case is in details described here: https://forum.nette.org/cs/36601-rfc-konverze-na-datovy-typ-enum-a-int-pri-mapovani-hodnot-formulare

dg and others added 20 commits June 11, 2024 22:48
- global is for testing & building
- nette-forms moved to src/assets
Nette forms doesnt support data type Enum when mapping form values to class. This makes problems when using forms - see error reported here: https://forum.nette.org/cs/36594-prevod-vybraneho-optionu-v-selectu-na-enum-type

The fix isnt complicated and makes no BC break. The case is in more details discussed here: https://forum.nette.org/cs/36601-rfc-konverze-na-datovy-typ-enum-a-int-pri-mapovani-hodnot-formulare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants