Commit 0344047a authored by Lennart Regebro's avatar Lennart Regebro

Fix for collector #2261. At least an ugly temporary fix. This could be cleaned up a

lot, but even better, we should take further steps towards using the z3 publisher.
parent dc182855
...@@ -72,6 +72,7 @@ Zope Changes ...@@ -72,6 +72,7 @@ Zope Changes
interfaces.py) interfaces.py)
Bugs Fixed Bugs Fixed
- Collector #2261: Acquisition when creating objects via Webdav.
- Collector #2263: 'field2ulines' did not convert empty string - Collector #2263: 'field2ulines' did not convert empty string
correctly. correctly.
......
...@@ -427,6 +427,17 @@ class BaseRequest: ...@@ -427,6 +427,17 @@ class BaseRequest:
# BrowserDefault returns the object to be published # BrowserDefault returns the object to be published
# (usually self) and a sequence of names to traverse to # (usually self) and a sequence of names to traverse to
# find the method to be published. # find the method to be published.
# This is webdav support. The last object in the path
# should not be acquired. Instead, a NullResource should
# be given if it doesn't exist:
if (no_acquire_flag and
hasattr(object, 'aq_base') and
not hasattr(object,'__bobo_traverse__')):
if object.aq_parent is not object.aq_inner.aq_parent:
from webdav.NullResource import NullResource
object = NullResource(parents[-2], object.getId(), self).__of__(parents[-2])
if IBrowserPublisher.providedBy(object): if IBrowserPublisher.providedBy(object):
adapter = object adapter = object
else: else:
......
...@@ -80,7 +80,7 @@ class TestPUTFactory(unittest.TestCase): ...@@ -80,7 +80,7 @@ class TestPUTFactory(unittest.TestCase):
put = request.traverse('/A/B/a') put = request.traverse('/A/B/a')
put(request, request.RESPONSE) put(request, request.RESPONSE)
# PUT should no acquire A.a # PUT should no acquire A.a
self.assertEqual(str(self.app.A.a), 'I am file a', 'PUT factory not should acquire content') self.assertEqual(str(self.app.A.a), 'I am file a', 'PUT factory should not acquire content')
# check for the newly created file # check for the newly created file
self.assertEqual(str(self.app.A.B.a), 'bar') self.assertEqual(str(self.app.A.B.a), 'bar')
......
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