-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add / Edit forms - Any way to preserve file uploads when form validation errors occur? #43
Comments
I don't think there's currently any infrastructure to handle this, but it would be a really nice feature to have. SubstanceD does this by putting the files in a temporary directory and a reference to them in the user's session: https://github.com/Pylons/substanced/blob/master/substanced/form/__init__.py In order to use that approach for Plone we'd want to use a session mechanism that doesn't write to the ZODB temporary store (which tends to cause conflicts and requires setting up session affinity in your load balancer). Maybe a signed cookie. |
We could do this with plone.app.drafts. I added a simple Dexterity-support for it for Mosaic, but this particular use case is not yet supported (it auto-saves values on validation, but only when the validation passes; also it does not re-use auto-saved values on final save, which would be the case here). Plone.app.drafts does not require Mosaic. It is activated for content types by enabling drafting behavior. Plone.app.drafts tries to avoid conflicts by making separate draft BTree for each authenticated user. |
Couldn't this actually be handled by either session/local storage (HTML 5 new thingies)? |
Maybe, but:
|
File uploads are preserved now, at least in Plone 5.2. I remember I have seen that, but I don't remember in which package this was done. |
Hello
Before I spend too much time digging through the code I figured I'd ask if anyone has already covered this. If I go to add or edit an object that has a NamedBlobImage field on it I can see a file upload widget. If I specify a file but another form validation error occurs my uploaded file is lost. This is particularly frustrating if the upload takes a long time to upload in the first place.
Is there any way to configure the Dexterity forms to not lose the uploaded files when a validation error occurs?
Thankyou.
FYI, I'm using Plone 4.3.
The text was updated successfully, but these errors were encountered: