keep compatibility with Python Expressions using 'CONTEXTS' on Zope 2.12

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32099 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e69ae9e7
...@@ -184,6 +184,11 @@ class TALESValue(StaticValue): ...@@ -184,6 +184,11 @@ class TALESValue(StaticValue):
elif kw.get('cell', None) is None: elif kw.get('cell', None) is None:
if getattr(REQUEST, 'cell', None) is not None: if getattr(REQUEST, 'cell', None) is not None:
kw['cell'] = getattr(REQUEST, 'cell') kw['cell'] = getattr(REQUEST, 'cell')
# on Zope 2.12, only path expressions can access the CONTEXTS name
# but ERP5 has many python expressions that try to access CONTEXTS, so
# we try to keep backward compatibility
if self.tales_expr._text.startswith("python:"):
kw['CONTEXTS'] = kw
try: try:
value = self.tales_expr.__of__(field)(**kw) value = self.tales_expr.__of__(field)(**kw)
except (ConflictError, RuntimeError): except (ConflictError, RuntimeError):
......
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