[Zope-dev] call for comments for bug 159232

Lorenzo Gil Sánchez lgs at sicem.biz
Thu May 1 05:35:09 EDT 2008


Hi everybody,

I'd like to know your opinion about bug 159232:

https://bugs.launchpad.net/zope3/+bug/159232

It's about a IMHO wrong test in ItemDisplayWidget of the zope.app.form
package.

I've made a patch (the second one in that bug) with a test that exercise
the bug and a fix for it but I'm not sure about the correctness of it
and that's why I ask you for review.

Here is the problem:

 - When the values of a vocabulary are containers and they are *empty*
the __call__ method of ItemDisplayWidget will return an empty string for
them, instead of its matching token.

There are two possible solutions:

 A) Change the test inside the __call__ method so when checking the
result of self._getFormValue() it explicitily checks for the empty
string

 B) Do the conversion from the vocabulary value to a form value in a
custom _getFormValue method in the ItemDisplayWidget class

What do you guys think?


best regards,

Lorenzo



More information about the Zope-Dev mailing list