[Zope-dev] Bug in Zope VersionControl

Christian Theune ct@gocept.com
Thu, 7 Jun 2001 20:30:26 +0200


--mP3DRpeJDSE+ciuQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hello again ...

Okay ... I admit using opera and enjoying it.

Problem is, that opera is sooo standardsconform.

See Zope/lib/python/Products/OFSP/Version.py:175
in function enter()

Somebody thats the path for the cookie as SCRIPT_NAME.
This seems that the scope of the versions should be
limited to the subtree where the version object was 
instanciated. Nice idea.

But this doesn't work.

First:

Internet Explorer and Netscape ignore the path of the cookie
and assume '/'.

Second:

Opera is conform to the rfc of http 1.1, and this means, that 
the cookie is only valid for the version itself, and is not
used in any place out of http://myzope:8080/blaah/myVersion

Proposed solution:

 Change the path to '/'. And have the same behaviour on all
 browsers.

Or:

 Change the path to REQUEST["URL1"] (is this the parent folder?)
 and have the intended mechanism working at least on opera.

 The last is my personal favorite, because you can have different
 versions concurrently open on different projects @ one server.

Proposed patch for both solutions comes as attachement.

(both intended for zope 2.4.0a1)

(btw: remember same behaviour on function leave() ...)

-- 
Christian Theune - ct@gocept.com
gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

--mP3DRpeJDSE+ciuQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="version1.patch"

--- Version.py	Thu Jan 11 16:43:57 2001
+++ lib/python/Products/OFSP/Version.py	Thu Jun  7 20:25:20 2001
@@ -172,7 +172,7 @@
         """Begin working in a version"""
         RESPONSE.setCookie(
             Globals.VersionNameName, self.cookie,
-            path=REQUEST['SCRIPT_NAME'],
+            path='/',
             )
         if (REQUEST.has_key('SERVER_SOFTWARE') and
             REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'):
@@ -190,7 +190,7 @@
         RESPONSE.setCookie(
             Globals.VersionNameName,'No longer active',
             expires="Mon, 25-Jan-1999 23:59:59 GMT",
-            path=REQUEST['SCRIPT_NAME'],
+            path='/',
             )
         if (REQUEST.has_key('SERVER_SOFTWARE') and
             REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'):

--mP3DRpeJDSE+ciuQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="version2.patch"

--- Version.py	Thu Jan 11 16:43:57 2001
+++ lib/python/Products/OFSP/Version.py	Thu Jun  7 20:25:20 2001
@@ -172,7 +172,7 @@
         """Begin working in a version"""
         RESPONSE.setCookie(
             Globals.VersionNameName, self.cookie,
-            path=REQUEST['SCRIPT_NAME'],
+            path=REQUEST['URL1'],
             )
         if (REQUEST.has_key('SERVER_SOFTWARE') and
             REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'):
@@ -190,7 +190,7 @@
         RESPONSE.setCookie(
             Globals.VersionNameName,'No longer active',
             expires="Mon, 25-Jan-1999 23:59:59 GMT",
-            path=REQUEST['SCRIPT_NAME'],
+            path=REQUEST['URL1'],
             )
         if (REQUEST.has_key('SERVER_SOFTWARE') and
             REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'):

--mP3DRpeJDSE+ciuQ--