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 ...@@ -6,6 +6,10 @@ Zope Changes
Bugs Fixed 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 broken management form for TopicIndexes.
- Fixed bug in z2.py where it would eat certain socket error exceptions - Fixed bug in z2.py where it would eat certain socket error exceptions
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Property management""" """Property management"""
__version__='$Revision: 1.46 $'[11:-2] __version__='$Revision: 1.47 $'[11:-2]
import ExtensionClass, Globals import ExtensionClass, Globals
import ZDOM import ZDOM
...@@ -259,7 +259,7 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes): ...@@ -259,7 +259,7 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
for prop in self._propertyMap(): for prop in self._propertyMap():
name=prop['id'] name=prop['id']
if 'w' in prop.get('mode', 'wd'): if 'w' in prop.get('mode', 'wd'):
value=REQUEST.get(name, '') value=REQUEST.get(name, type_converters[prop['type']](''))
self._updateProperty(name, value) self._updateProperty(name, value)
if REQUEST: if REQUEST:
message="Saved changes." message="Saved changes."
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.18 $'[11:-2] __version__='$Revision: 1.19 $'[11:-2]
import re import re
from types import ListType, TupleType, UnicodeType from types import ListType, TupleType, UnicodeType
...@@ -147,20 +147,21 @@ class field2ulines(_unicode_converter): ...@@ -147,20 +147,21 @@ class field2ulines(_unicode_converter):
field2ulines = field2ulines() field2ulines = field2ulines()
type_converters = { type_converters = {
'float': field2float, 'float': field2float,
'int': field2int, 'int': field2int,
'long': field2long, 'long': field2long,
'string': field2string, 'string': field2string,
'date': field2date, 'date': field2date,
'required': field2required, 'required': field2required,
'tokens': field2tokens, 'tokens': field2tokens,
'lines': field2lines, 'lines': field2lines,
'text': field2text, 'text': field2text,
'boolean': field2boolean, 'boolean': field2boolean,
'ustring': field2ustring, 'multiple selection': field2lines,
'utokens': field2utokens, 'ustring': field2ustring,
'ulines': field2ulines, 'utokens': field2utokens,
'utext': field2utext, 'ulines': field2ulines,
'utext': field2utext,
} }
get_converter=type_converters.get 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