Commit ce2e49e1 authored by wenjie.zheng's avatar wenjie.zheng

Expression.py: patch createExprContent directly on the original function.

parent df87b9e2
......@@ -14,8 +14,8 @@
# Expression patch
from Products.CMFCore.Expression import Expression
from Products.DCWorkflow.Expression import createExprContext
from Products.CMFCore.Expression import Expression as CMFCore_Expression
from Products.DCWorkflow import Expression
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.PageTemplates.Expressions import getEngine
......@@ -26,11 +26,11 @@ from Products.DCWorkflow.Expression import StateChangeInfo
def Expression_hash(self):
return hash(self.text)
Expression.__hash__ = Expression_hash
CMFCore_Expression.__hash__ = Expression_hash
# compatibility according to the new structure of workflow:
# deploy script getter to return a list of script.
def createExprContext(sci):
def _createExprContext(sci):
'''
An expression context provides names for TALES expressions.
'''
......@@ -56,3 +56,5 @@ def createExprContext(sci):
'scripts': scripts,
}
return getEngine().getContext(data)
Expression.createExprContext = _createExprContext
\ No newline at end of file
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