SomeWidget._getFormValue() often doesn't return a string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 3 |
Invalid
|
Medium
|
Unassigned |
Bug Description
A lot of input widgets derive from SimpleInputWidget, which defines _getFormValue(). According to the docstring it should return a value suitable for use in a HTML form, which I interpret as it should be a string that can be uses as the HTML tag's value attribute.
The problem is that the default implementation deals only with the case where _toFieldValue(foo) returns a string. If you for example have a ChoiceInputWidget, with a vocabulary containing something else than strings, ChoiceInputWidg
Widgets that derive from SimpleInputWidget and deal with non-string objects should override the _toFormValue() method in order to convert the object to a string that can be used in a HTML form. Note that a lot of code depend on the old behaviour, for example SingleDataHelper.
Changes: submitter email, importance (medium => critical)