Ticket #12343 (confirmed Bug)
Dexterity based types report zero size to WebDAV clients
Reported by: | kleist | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 4.x |
Component: | Dexterity | Version: | 4.1 |
Keywords: | webdav | Cc: |
Description
Plone 4.2 coredev buildout, http://good-py.appspot.com/release/dexterity/1.0.3-1
In the response from Plone on a PROPFIND request:
<n:getcontentlength xmlns:n="DAV:">0</n:getcontentlength>
This behavior is a regression compared to AT based types, which do report a non-zero size.
An effect is that the WebDAV client "WebDrive" (South River Technologies) actually forces such a file to become zero sized, i.e. empty. (Arguably, this is a bug of WebDrive; I'll report it to their support team.)
The Cyberduck client opens "zero sized" files without second thoughts.
This horrible kludge in my content-type class works around the problem:
class XMLDocument(dexterity.Item): grok.implements(IXMLDocument) def get_size(self): return 1
Relevant code:
https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/filerepresentation.py#L59
https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/content.py#L164
https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/content.py#L243
See also:
Moved to http://code.google.com/p/dexterity/issues/detail?id=243 since Dexterity currently is not part of Plone core (but will be in 4.3?).