Commit d7b6ec25 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Pass the physical path of the portal.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2914 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f1e3e016
......@@ -630,7 +630,7 @@ be a problem)."""
List portal_types which can be added in this folder / object.
Cache results. This requires restarting Zope to update values.
"""
def _allowedContentTypes(portal_type=None, user=None):
def _allowedContentTypes(portal_type=None, user=None, portal_path=None):
# Sort the list for convenience -yo
# XXX This is not the best solution, because this does not take account i18n into consideration.
# XXX So sorting should be done in skins, after translation is performed.
......@@ -642,7 +642,8 @@ be a problem)."""
_allowedContentTypes = CachingMethod(_allowedContentTypes, id='allowedContentTypes', cache_duration = 300)
user = str(_getAuthenticatedUser(self))
portal_type = self.getPortalType()
return _allowedContentTypes(portal_type=portal_type, user=user)
portal_path = self.getPortalObject().getPhysicalPath()
return _allowedContentTypes(portal_type=portal_type, user=user, portal_path=portal_path)
# Multiple Inheritance Priority Resolution
......
......@@ -354,7 +354,7 @@ class PatchedDCWorkflowDefinition(DCWorkflowDefinition):
Called on every request.
Returns the actions to be displayed to the user.
'''
def _listGlobalActions(user=None, id=None):
def _listGlobalActions(user=None, id=None, portal_path=None):
if not self.worklists:
return None # Optimization
sm = getSecurityManager()
......@@ -413,7 +413,7 @@ class PatchedDCWorkflowDefinition(DCWorkflowDefinition):
# Return Cache
_listGlobalActions = CachingMethod(_listGlobalActions, id='listGlobalActions', cache_duration = 300)
user = str(_getAuthenticatedUser(self))
return _listGlobalActions(user=user, id=self.id)
return _listGlobalActions(user=user, id=self.id, portal_path=self._getPortalRoot().getPhysicalPath())
DCWorkflowDefinition.listGlobalActions = PatchedDCWorkflowDefinition.listGlobalActions
......
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