Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Image nulled when reloading form because of validation and uploading at the same time #3

Closed
ThomasRo opened this issue Sep 10, 2014 · 6 comments

Comments

@ThomasRo
Copy link

When i edit an existing example object, do remove the title so that the field is blank and upload a new image at the same time, everythink works fine in the edit form:
The uploaded image is placed as preview and will be adopted if i fill out the title this time and save the object. But in the meanwhile the image field has been nulled in the database so that there is no image anymore.
For many cases in production this can be unwished.

PS: Great work, thanks!

@helhum helhum closed this as completed in a30fc9f Sep 11, 2014
@helhum
Copy link
Owner

helhum commented Sep 11, 2014

This should be fixed with the latest commit. Please give feedback if it also works for you.

@ThomasRo
Copy link
Author

It does work, but creates another problem: The image field is not being nulled, but he file which has been uploaded gets lost. The old relation is kept and i have to upload the file again.

@helhum
Copy link
Owner

helhum commented Sep 11, 2014

Can you provide a step by step instruction to reproduce?

@helhum
Copy link
Owner

helhum commented Sep 11, 2014

Ah sorry, forgot to add a configuration file in the last commit. Should be working now with latest master

@ThomasRo
Copy link
Author

Still the same problem:
When an validation error occurs, the right preview (of the new uploaded file) is shown. But it does not get saved when submitting again with a correct filled form without selecting the file once again.

@helhum
Copy link
Owner

helhum commented Sep 17, 2014

True. I created #4 for this bug.

I will not be able to work on that with the next 5-6 weeks. Pull requests are welcome though ;)

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

No branches or pull requests

2 participants