These are chat archives for symfony2admingenerator/GeneratorBundle

25th
Jun 2015
Dražen Perić
@peric
Jun 25 2015 10:18
I have a problem with "s2a_single_upload" form type (https://github.com/symfony2admingenerator/FormExtensionsBundle/blob/master/Resources/doc/single-upload/overview.md).
For example, when adding an image, image gets previewed and it gets saved after object is stored. But, on the edit form, it always looks like image is not there, even if it is attached to the object and it gets shown on the frontend. Any ideas how to preview/show that image also on edit form?

This is how it looks like: http://www.awesomescreenshot.com/image/355971/8a1df230a397c4018208de556da5a964

Even if image is actually there.

Dražen Perić
@peric
Jun 25 2015 12:13
And also - image field is required so after saving an object next time, it will fail, since it's not aware that image is already there - it just checks whether it's actually set.
Dražen Perić
@peric
Jun 25 2015 12:57
So any idea how to deal with it? It's quite a blocker :/
Stéphane
@sescandell
Jun 25 2015 12:59

Hi @peric

Sorry, it's difficuult to get time these days

I've made a sample about single_upload image in this repository
you'll find a sample use of afe_single_upload on the Product entity
that said, this is from the "old" bundle
maybe some things changed
something that would be usefull too is a quick way to reproduce your case so we can dive into your code
it might become from many things
(miss-cofiguration of the formType or vichuploader or...)
Dražen Perić
@peric
Jun 25 2015 13:04
So you're saying this worked usually?
Dražen Perić
@peric
Jun 25 2015 13:16
I mean - upload, preview on upload and everything else works for me also and I think configuration is fine, but I also want to see that image is there after it's uploaded.
Stéphane
@sescandell
Jun 25 2015 16:26
At least, in the sample above, yes it is :)