Commit 0187dcaa authored by Nicolas Dumazet's avatar Nicolas Dumazet

- Add patch loading to ERP5Type/ZopePatch instead of inside ERP5Site, and

  to solve circular imports:
- Modify directly CMFActivity for 2.12 instead of monkey-patching it.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38618 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f5b5593f
......@@ -67,6 +67,7 @@ except ImportError:
from ZODB.POSException import ConflictError
from Products.MailHost.MailHost import MailHostError
from zope.site.hooks import setSite
from zLOG import LOG, INFO, WARNING, ERROR
from warnings import warn
......@@ -877,6 +878,9 @@ class ActivityTool (Folder, UniqueObject):
if not acquired:
return
portal = self.getPortalObject()
setSite(portal)
# make sure our skin is set-up. On CMF 1.5 it's setup by acquisition,
# but on 2.2 it's by traversal, and our site probably wasn't traversed
# by the timerserver request, which goes into the Zope Control_Panel
......
......@@ -37,7 +37,6 @@ from Products.CMFActivity.Errors import ActivityPendingError
import ERP5Defaults
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Products.ERP5Type.patches.getSite import getSite as load_this_patch_now
from zope.site.hooks import setSite
from zLOG import LOG, INFO
......
......@@ -70,3 +70,4 @@ from Products.ERP5Type.patches import ZopePageTemplate
from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager
from Products.ERP5Type.patches.DCWorkflow import ValidationFailed, ERP5TransitionDefinition
from Products.ERP5Type.patches.BTreeFolder2 import ERP5BTreeFolder2Base
from Products.ERP5Type.patches.getSite import getSite
......@@ -58,11 +58,3 @@ def getSite():
return portal
hooks.getSite = getSite
from Products.CMFActivity.ActivityTool import ActivityTool
ActivityTool_process_timer = ActivityTool.process_timer
def process_timer(self, *args, **kw):
portal = self.getPortalObject()
hooks.setSite(portal)
return ActivityTool_process_timer(self, *args, **kw)
ActivityTool.process_timer = process_timer
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