Commit f4a5b0c1 authored by Sidnei da Silva's avatar Sidnei da Silva

- Display index name on error message when index can't be used as

       'sort_on'.

     - PUT would fail if the created object had a __len__ = 0 (eg:
       BTreeFolder2) and fallback to _default_put_factory. Fix by
       checking if the returned object is None instead.
parent 28a89d65
......@@ -105,6 +105,13 @@ Zope Changes
Bugs fixed
- Display index name on error message when index can't be used as
'sort_on'.
- PUT would fail if the created object had a __len__ = 0 (eg:
BTreeFolder2) and fallback to _default_put_factory. Fix by
checking if the returned object is None instead.
- Collector #1160: HTTPResponse.expireCookie() potentially didn't
when an 'expires' keyword argument was passed.
......
......@@ -735,12 +735,12 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# self.indexes is always a dict, so get() w/ 1 arg works
sort_index = self.indexes.get(sort_index_name)
if sort_index is None:
raise CatalogError, 'Unknown sort_on index'
raise CatalogError, 'Unknown sort_on index (%s)' % sort_index_name
else:
if not hasattr(sort_index, 'keyForDocument'):
raise CatalogError(
'The index chosen for sort_on is not capable of being'
' used as a sort index.'
'The index chosen for sort_on (%s) is not capable of being'
' used as a sort index.' % sort_index_name
)
return sort_index
else:
......
......@@ -13,7 +13,7 @@
"""WebDAV support - null resource objects."""
__version__='$Revision: 1.42 $'[11:-2]
__version__='$Revision: 1.43 $'[11:-2]
import sys, Globals, davcmds
import Acquisition, OFS.content_types
......@@ -107,8 +107,10 @@ class NullResource(Persistent, Acquisition.Implicit, Resource):
typ, enc=OFS.content_types.guess_content_type(name, body)
factory = getattr(parent, 'PUT_factory', self._default_PUT_factory )
ob = (factory(name, typ, body) or
self._default_PUT_factory(name, typ, body)
ob = factory(name, typ, body)
ob = (ob is None and
self._default_PUT_factory(name, typ, body) or
ob
)
# We call _verifyObjectPaste with verify_src=0, to see if the
# user can create this type of object (and we don't need to
......
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