[Zope-Checkins] SVN: Zope/trunk/ - webdav.Resource: during COPY, manage_afterClone was called way

Sidnei da Silva sidnei at awkly.org
Wed Dec 1 15:20:54 EST 2004


Log message for revision 28549:
  
        - webdav.Resource: during COPY, manage_afterClone was called way
          too early, thus the object wasn't bound to the database and
          couldn't find a context. Changed to behave the same way as
          CopySupport.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/webdav/Resource.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2004-12-01 19:09:28 UTC (rev 28548)
+++ Zope/trunk/doc/CHANGES.txt	2004-12-01 20:20:54 UTC (rev 28549)
@@ -46,10 +46,15 @@
 
     Bugs fixed
 
+      - webdav.Resource: during COPY, manage_afterClone was called way
+        too early, thus the object wasn't bound to the database and
+        couldn't find a context. Changed to behave the same way as
+        CopySupport.
+
       - RAMCacheManager: opimized performance by using cPickle instead
         of pickle and by using the highest pickle protocol available
         instead of using ASCII pickles (patch by Dieter Maurer)
-        
+
       - Collector #631: Image URLs in StructuredText containing port
         numbers were not rendered correctly
 
@@ -95,12 +100,12 @@
         header before it is considered as a possible DoS attack and
         discarded.
 
-      - Collector #1371: added new 'cgi-maxlen' directive to zope.conf 
-        to limit the amount of form data being processed by Zope 
+      - Collector #1371: added new 'cgi-maxlen' directive to zope.conf
+        to limit the amount of form data being processed by Zope
         to prevent DoS attacks
 
       - Collector #1407: changed WebDAV display name for objects
-        to title_or_id() 
+        to title_or_id()
 
       - the 'trusted-proxy' directive in zope.conf now also accepts
         hostnames instead of IP addresses only (patch by Dieter Maurer)
@@ -126,8 +131,8 @@
         since latin1 is obsolete.
 
       - Collector #1566: Installation of Zope on some older Solaris versions
-        could fail due to a broken "echo" implementation causing the 
-        creation of a borked version.txt file.                       
+        could fail due to a broken "echo" implementation causing the
+        creation of a borked version.txt file.
 
       - Collector #934: Image and File objects are now always internally
         split into small chunks even when initialized from a string.

Modified: Zope/trunk/lib/python/webdav/Resource.py
===================================================================
--- Zope/trunk/lib/python/webdav/Resource.py	2004-12-01 19:09:28 UTC (rev 28548)
+++ Zope/trunk/lib/python/webdav/Resource.py	2004-12-01 20:20:54 UTC (rev 28549)
@@ -366,13 +366,9 @@
             else:
                 raise Locked, 'Destination is locked.'
 
-        ob=self._getCopy(parent)
-        ob.manage_afterClone(ob)
-        # We remove any locks from the copied object because webdav clients
-        # don't track the lock status and the lock token for copied resources
-        ob.wl_clearLocks()
+        ob = self._getCopy(parent)
+        ob._setId(name)
 
-        ob._setId(name)
         if depth=='0' and isDavCollection(ob):
             for id in ob.objectIds():
                 ob._delObject(id)
@@ -381,6 +377,11 @@
             self.dav__validate(object, 'DELETE', REQUEST)
             parent._delObject(name)
         parent._setObject(name, ob)
+        ob = parent._getOb(name)
+        ob.manage_afterClone(ob)
+        # We remove any locks from the copied object because webdav clients
+        # don't track the lock status and the lock token for copied resources
+        ob.wl_clearLocks()
         RESPONSE.setStatus(existing and 204 or 201)
         if not existing:
             RESPONSE.setHeader('Location', dest)



More information about the Zope-Checkins mailing list