Commit 163fa9a9 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Due to a bootstrap problem that using objects as keys of a set calls getUID...

Due to a bootstrap problem that using objects as keys of a set calls getUID implicitly, while portal_catalog is not available yet, it is necessary to avoid setting objects as keys.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24164 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e55c11ee
...@@ -1559,7 +1559,7 @@ class Base( CopyContainer, ...@@ -1559,7 +1559,7 @@ class Base( CopyContainer,
hasProperty is False will be updated. hasProperty is False will be updated.
""" """
modified_property_dict = self._v_modified_property_dict = {} modified_property_dict = self._v_modified_property_dict = {}
modified_object_set = set() modified_object_dict = {}
key_list = kw.keys() key_list = kw.keys()
unordered_key_list = [k for k in key_list if k not in edit_order] unordered_key_list = [k for k in key_list if k not in edit_order]
...@@ -1612,7 +1612,11 @@ class Base( CopyContainer, ...@@ -1612,7 +1612,11 @@ class Base( CopyContainer,
# that self has been modified. # that self has been modified.
if modified_object_list is None: if modified_object_list is None:
modified_object_list = (self,) modified_object_list = (self,)
modified_object_set.update(modified_object_list) for o in modified_object_list:
# XXX using id is not quite nice, but getUID causes a
# problem at the bootstrap of an ERP5 site. Therefore,
# objects themselves cannot be used as keys.
modified_object_dict[id(o)] = o
else: else:
self.setId(kw['id'], reindex=reindex_object) self.setId(kw['id'], reindex=reindex_object)
else: else:
...@@ -1625,7 +1629,7 @@ class Base( CopyContainer, ...@@ -1625,7 +1629,7 @@ class Base( CopyContainer,
setChangedPropertyList(ordered_key_list) setChangedPropertyList(ordered_key_list)
if reindex_object: if reindex_object:
for o in modified_object_set: for o in modified_object_dict.itervalues():
o.reindexObject(activate_kw=activate_kw) o.reindexObject(activate_kw=activate_kw)
security.declareProtected( Permissions.ModifyPortalContent, 'setId' ) security.declareProtected( Permissions.ModifyPortalContent, 'setId' )
......
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