[Zope3-dev] Cleaning up the widget mess a little bit: bug or feature

Christian Theune ct at gocept.com
Thu Dec 14 07:55:22 EST 2006


Hi,

Zagy and I stumbled over the widgets today, and I already had a
workaround sitting on a widget that we wrote and wanted to remove this
issue.

The issue is that the method "_getCurrentValue" sometimes returns an
'input value' and sometimes 'a form value' (specifically: it returns a
form value if the method getInputValue wasn't able to validate/convert
the data from the request).

However, the method "_getFormValue" always assumes that
"_getCurrentValue" returns an "input value" and uses "_toFormValue" to
convert it into a form value.

In the case, that "_getCurrentValue" returned a "form value", this
*sometimes* breaks, depending on the widget's implementation of
"_toFormValue".

Zagy and I fixed this issue, by making the methods "_getCurrentValue"
and "_getFormValue" use a common method to retrieve the "input value"
and handle the case of converting to the "form value" cleanly.

However, we are not sure, whether this should be considered a bug or a
feature and would like to discuss whether this should be back ported.

You can find the change set in r71548.

(We documented the change in the 'Bug fixes' section of the CHANGES.txt
for now.)

Cheers,
Christian**2

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20061214/6e0670a0/signature.bin


More information about the Zope3-dev mailing list