Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP PUT uploading to dexterity container folder in site is broken -- returns 404 not found #147

Open
Rudd-O opened this issue Apr 29, 2021 · 1 comment

Comments

@Rudd-O
Copy link

Rudd-O commented Apr 29, 2021

(Formerly plone/plone.app.dexterity#327 )

Any HTTP PUT (e.g. with WebDAV or with basic curl) to a Dexterity folder receives a response HTTP 404 Not Found, but it's truly the most curious thing, because a PUT of the same file in the parent directory (Plone site) succeeds, and then a PUT of the same file in the current directory succeeds afterwards!

In the following example /manuelamador.name/ is a Plone site, and /manuelamador.name/intranet/ is a Dexterity container (regular Folder) added in the Plone site.

Listing collection `/manuelamador.name/intranet/': succeeded.
Coll:   foldr                                  0  Apr 29 15:50
        _data                                  0  Apr 29 16:00
dav:/manuelamador.name/intranet/> put abc.txt
Uploading abc.txt to `/manuelamador.name/intranet/abc.txt':
Progress: [=============================>] 100.0% of 15 bytes failed:
404 Not Found
dav:/manuelamador.name/intranet/> cd ..
dav:/manuelamador.name/> put abc.txt
Uploading abc.txt to `/manuelamador.name/abc.txt':
Progress: [=============================>] 100.0% of 15 bytes succeeded.
dav:/manuelamador.name/> cd intranet
dav:/manuelamador.name/intranet/> put abc.txt
Uploading abc.txt to `/manuelamador.name/intranet/abc.txt':
Progress: [=============================>] 100.0% of 15 bytes succeeded.
dav:/manuelamador.name/intranet/> rm ../abc.txt
Deleting `../abc.txt': succeeded.
dav:/manuelamador.name/intranet/> rm abc.txt
Deleting `abc.txt': succeeded.
dav:/manuelamador.name/intranet/> put abc.txt
Uploading abc.txt to `/manuelamador.name/intranet/abc.txt':
Progress: [=============================>] 100.0% of 15 bytes failed:
404 Not Found
dav:/manuelamador.name/intranet/> 

This only happens with Dexterity containers. Regular Zope folders work well with HTTP PUT. So do Plone site roots.

Of course, this is bad because MKCOL inside a Plone site root creates a Dexterity container, so any new folders must be created through the ZMI. And using the ZMI is a non starter.

This appears to be caused by a defect in publishTraverse() of plone/dexterity/browser/traversal.py.

I will shortly fix it with a PR.

EDIT: I tried to fix it but I couldn't.

@Rudd-O
Copy link
Author

Rudd-O commented Dec 21, 2021

HTTP PUT works on Plone 6, albeit with the caveat in #162 . Please close when Plone 6 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant