[Zope3-dev] bug setting value to None via edit form

Richard Jones richard@commonground.com.au
Tue, 15 Jul 2003 10:36:26 +1000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday, July 15, 2003, at 06:30  AM, Garrett Smith wrote:
> Independent of the field.missing_value issue, I still think the
> following code (in utility.py, line 174):
>
>     if value is not None and (force or not widget.haveData()):
>         widget.setData(value)
>
> needs to be:
>
>     if force or not widget.haveData():
>         widget.setData(value)
>
> The filter "value is not None" is bad, since None is a legal value to
> pass to the widget.
>
> This bug shows up when you delete an integer (i.e. Int field) value in
> an HTML form -- the value in the field is updated, but the form is
> displayed with the old value...because of that improper check for None.

+1


    Richard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE/E0yLrGisBEHG6TARAuuFAJ4hP5dSJLUd6ojqjqyZqpP6h2xn/ACeOq4q
4APvZAA3CvzXAg3OYdrCWZ8=
=2jUj
-----END PGP SIGNATURE-----