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
interfaces.py)
Bugs Fixed
- Collector #2261: Acquisition when creating objects via Webdav.
- Collector #2263: 'field2ulines' did not convert empty string
correctly.
......
......@@ -427,6 +427,17 @@ class BaseRequest:
# BrowserDefault returns the object to be published
# (usually self) and a sequence of names to traverse to
# 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):
adapter = object
else:
......
......@@ -80,7 +80,7 @@ class TestPUTFactory(unittest.TestCase):
put = request.traverse('/A/B/a')
put(request, request.RESPONSE)
# 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
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