Commit a501eb84 authored by Chris Withers's avatar Chris Withers

Fixed bug in manage_editProperties which used an incorrect default for several...

Fixed bug in manage_editProperties which used an incorrect default for several types of property when they were not found in the REQUEST.
parent 910efb13
......@@ -6,6 +6,10 @@ Zope Changes
Bugs Fixed
- Fixed bug in manage_editProperties which used an incorrect default
for several types of property when they were not found in the
REQUEST.
- Fixed broken management form for TopicIndexes.
- Fixed bug in z2.py where it would eat certain socket error exceptions
......
......@@ -12,7 +12,7 @@
##############################################################################
"""Property management"""
__version__='$Revision: 1.46 $'[11:-2]
__version__='$Revision: 1.47 $'[11:-2]
import ExtensionClass, Globals
import ZDOM
......@@ -259,7 +259,7 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
for prop in self._propertyMap():
name=prop['id']
if 'w' in prop.get('mode', 'wd'):
value=REQUEST.get(name, '')
value=REQUEST.get(name, type_converters[prop['type']](''))
self._updateProperty(name, value)
if REQUEST:
message="Saved changes."
......
......@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
__version__='$Revision: 1.18 $'[11:-2]
__version__='$Revision: 1.19 $'[11:-2]
import re
from types import ListType, TupleType, UnicodeType
......@@ -147,20 +147,21 @@ class field2ulines(_unicode_converter):
field2ulines = field2ulines()
type_converters = {
'float': field2float,
'int': field2int,
'long': field2long,
'string': field2string,
'date': field2date,
'required': field2required,
'tokens': field2tokens,
'lines': field2lines,
'text': field2text,
'boolean': field2boolean,
'ustring': field2ustring,
'utokens': field2utokens,
'ulines': field2ulines,
'utext': field2utext,
'float': field2float,
'int': field2int,
'long': field2long,
'string': field2string,
'date': field2date,
'required': field2required,
'tokens': field2tokens,
'lines': field2lines,
'text': field2text,
'boolean': field2boolean,
'multiple selection': field2lines,
'ustring': field2ustring,
'utokens': field2utokens,
'ulines': field2ulines,
'utext': field2utext,
}
get_converter=type_converters.get
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment