I used the yiic shell to generate models and forms.
Now i have a problem with all fields that are not required. When i fill the form and sumbit it, it saves the textfields I left blank as an empty value in the database instead of a null value.
This doesn’t give a big problem in ordinary fields. but on a field with a not required foreign key like country or currency it is trying to put an empty value as reference to the country table in the database. there is only no empty value in de country table. so that gives an foreign key error.
The values in the database are allowed to have a null value and default value is null.
Does any one know what the solution is to this problem?