[Checkins] SVN: z3ext.controlpanel/trunk/ fix data storage copy

Nikolay Kim fafhrd at datacom.kz
Thu Aug 28 11:10:51 EDT 2008


Log message for revision 90551:
  fix data storage copy

Changed:
  U   z3ext.controlpanel/trunk/CHANGES.txt
  U   z3ext.controlpanel/trunk/src/z3ext/controlpanel/configure.zcml
  U   z3ext.controlpanel/trunk/src/z3ext/controlpanel/storage.py

-=-
Modified: z3ext.controlpanel/trunk/CHANGES.txt
===================================================================
--- z3ext.controlpanel/trunk/CHANGES.txt	2008-08-28 15:10:02 UTC (rev 90550)
+++ z3ext.controlpanel/trunk/CHANGES.txt	2008-08-28 15:10:50 UTC (rev 90551)
@@ -2,6 +2,12 @@
 CHANGES
 =======
 
+1.2.6 (2008-08-28)
+------------------
+
+- Fixed data storage copy
+
+
 1.2.5 (2008-08-28)
 ------------------
 

Modified: z3ext.controlpanel/trunk/src/z3ext/controlpanel/configure.zcml
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/configure.zcml	2008-08-28 15:10:02 UTC (rev 90550)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/configure.zcml	2008-08-28 15:10:50 UTC (rev 90551)
@@ -22,7 +22,6 @@
 
   <!-- data storage -->
   <utility factory=".storage.DataStorage" />
-
   <subscriber handler=".storage.dataStorageCopied" />
 
   <!-- default categories -->

Modified: z3ext.controlpanel/trunk/src/z3ext/controlpanel/storage.py
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/storage.py	2008-08-28 15:10:02 UTC (rev 90550)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/storage.py	2008-08-28 15:10:50 UTC (rev 90551)
@@ -21,8 +21,8 @@
 from zope.proxy import removeAllProxies
 from zope.location.pickling import locationCopy
 from zope.location.interfaces import ILocation
-from zope.app.component.hooks import getSite
 from zope.app.component.interfaces import ISite
+from zope.app.component.hooks import getSite, setSite
 from zope.annotation.interfaces import IAnnotations
 from zope.lifecycleevent import ObjectCopiedEvent
 from zope.lifecycleevent.interfaces import IObjectCopiedEvent
@@ -71,6 +71,9 @@
 
 @component.adapter(ISite, IObjectCopiedEvent)
 def dataStorageCopied(site, appevent):
+    oldSite = getSite()
+    setSite(site)
+
     ann = IAnnotations(removeAllProxies(appevent.original), None)
     if ann is None:
         return
@@ -101,3 +104,5 @@
                 copy[subkey] = subcopy
 
         newStorage[key] = copy
+
+    setSite(oldSite)



More information about the Checkins mailing list