Commit 9c97f1c4 authored by Vincent Pelletier's avatar Vincent Pelletier

Don't use getattr to access subobjects on an acquisiton-wrapped object.

If some looked-up id is missing, it would be searched in acquisition, which is
not desired.
If some looked-up id exists as a method id on container's class, it will be
fetched instead of a subobject, which is not desired.

Example case, which happened to me: searching for "Title" returns an accessor
from CMF.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44185 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0d626d33
...@@ -300,8 +300,10 @@ def getPropertySheetValueList(site, property_sheet_name_set): ...@@ -300,8 +300,10 @@ def getPropertySheetValueList(site, property_sheet_name_set):
for property_sheet_name in property_sheet_name_set: for property_sheet_name in property_sheet_name_set:
try: try:
property_sheet = getattr(property_sheet_tool, property_sheet_name) property_sheet = property_sheet_tool._getOb(property_sheet_name)
except AttributeError: except (AttributeError, KeyError):
# XXX: OFS.Folder explicitly raises AttributeError, BTreeFolder2
# implicitly raises KeyError...
LOG("ERP5Type.dynamic", WARNING, LOG("ERP5Type.dynamic", WARNING,
"Ignoring missing Property Sheet " + property_sheet_name) "Ignoring missing Property Sheet " + property_sheet_name)
......
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