Search code examples
symfonyfile-uploadvichuploaderbundle

Symfony - can't get multiple file upload to work


I'm using VichUploaderBundle to upload files for a gallery. I have two entities - the first one is Gallery, and the second is GalleryImage.

THis is the code: http://pastebin.com/2nWAK2iH - Gallery Entity
http://pastebin.com/JWzWzZp2 - GalleryImage Entity
http://pastebin.com/TnZr24Sp - GalleryImageType Form
http://pastebin.com/9C8H25sn - GalleryType Form
http://tny.cz/26e859f6 - The Controller (part of it)

No matter what I do, I always get "An exception occurred while executing 'INSERT INTO GalleryImage (image_name, gallery_id) VALUES (?, ?)' with params [null, 8]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'image_name' cannot be null"

Any ideas what I'm doing wrong? Thanks

UPDATE The new GalleryImage file: http://pastebin.com/uKtqg4HE


Solution

  • Looks like the @Uploadable class annotation is missing in the GalleryImage class.