[CMF-checkins] SVN: CMF/trunk/CMFCore/PortalObject.py - added temporary hack for upgrading site instances created with CMF 2.1 beta

Yvo Schubbe y.2007- at wcm-solutions.de
Fri Jun 29 06:12:09 EDT 2007


Log message for revision 77234:
  - added temporary hack for upgrading site instances created with CMF 2.1 beta

Changed:
  U   CMF/trunk/CMFCore/PortalObject.py

-=-
Modified: CMF/trunk/CMFCore/PortalObject.py
===================================================================
--- CMF/trunk/CMFCore/PortalObject.py	2007-06-29 10:12:02 UTC (rev 77233)
+++ CMF/trunk/CMFCore/PortalObject.py	2007-06-29 10:12:08 UTC (rev 77234)
@@ -16,6 +16,7 @@
 """
 
 from five.localsitemanager import find_next_sitemanager
+from five.localsitemanager.registry import FiveVerifyingAdapterLookup
 from five.localsitemanager.registry import PersistentComponents
 from Globals import InitializeClass
 from Products.Five.component.interfaces import IObjectManagerSite
@@ -61,12 +62,22 @@
 
     def getSiteManager(self):
         if self._components is None:
+            # BBB: for CMF 2.0 instances
             next = find_next_sitemanager(self)
             if next is None:
                 next = base
             name = '/'.join(self.getPhysicalPath())
             self._components = PersistentComponents(name, (next,))
             self._components.__parent__ = self
+        elif self._components.utilities.LookupClass \
+                != FiveVerifyingAdapterLookup:
+            # BBB: for CMF 2.1 beta instances
+            # XXX: should be removed again after the CMF 2.1 beta2 release
+            self._components.utilities.LookupClass \
+                    = FiveVerifyingAdapterLookup
+            self._components.utilities._createLookup()
+            self._components.utilities.__parent__ = self._components
+            self._components.__parent__ = self
         return self._components
 
     def __before_publishing_traverse__(self, arg1, arg2=None):



More information about the CMF-checkins mailing list