When I clear the value of a field in my webform that is not mandatory (but if entered has to be between 30.00 and 999.00, so I cannot enter 0.0) and I save my webform, I don't get an error on my screen and a message that my webform is saved, but the value is not cleared and in my watchdog log I see:
The CiviCRM "CustomValueTable::setValues" function returned the error: "waarde: heeft niet het juiste velddatatype: Float" when called by line 154 of C:\Program Files\BitNami Drupal 6 Stack\apps\drupal\htdocs\sites\all\modules\webform_civicrm\webform_civicrm_utils.inc with the following parameters: "Array ( [entityID] => 140 [custom_16_0] => ) "
PS. "waarde: heeft niet het juiste velddatatype" is translated and means something like : "value: doesn't have the correct fielddatatype".
The field in my database is of the type double.

Comments

attiks’s picture

You cannot save an empty value to a float in the database, they either allow NULL or you have to provide a value, does this work without clientside validation?

BasH’s picture

Have to check this, maybe I have to accept 0 as valid. But initially the field is empty, so when I clear a field shouldn't it be updated to NULL?

BasH’s picture

Status: Postponed » Active

In my test-environment I upgraded CiviCRM to 4.1. When I clear my fieldvalue now, it is saved as 0, that is better than not saving it and 0 is almost the same as NULL(..). The only thing is that 0 is returned in my form also, so when I try to save this form again, I get the same message as before: 0 is not a correct value.
So I would still like the cleared field value to be saved as NULL, but it has improved a bit...
New/extra info: I had to revert to the previous version of CiviCRM and it behaved the same. So not the upgrade of CiviCRM but maybe the upgrade of Views 2.x to Views 3.0 changed this.

attiks’s picture

Does it behave the same with and without clientside_validation?

BasH’s picture

Status: Active » Postponed

At the moment I have no time to test this, maybe next week

Status: Active » Postponed