-
Notifications
You must be signed in to change notification settings - Fork 518
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
Help on basic configuration #92
Comments
@artworkad : when you getting this error, Doctrine will validate your imageName field. If you want to make this field optional add nullable=true to the annotation.
|
but no image is uploaded at all. so this seems not to be the problem? |
That's what I am saying. While don't upload any file. imageName field will be null, so doctrine won't allow to store other entity and throw the exception
if you add nullable=true. imageName field will become optional. |
Iadded the nullable=true statement. Image is inserted in DB but no image is not uploaded. |
Did you solve it meanwhile? I have exact the same issue |
No. For now I use http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html#using-lifecycle-callbacks However I guess the problem is that I mixed up xml mappings and annotation mappings. |
Damn, I've managed to make it work once and now it doesn't work anymore, same issue as yours... I may have updated with composer one of my bundles that broke this... If it's not because of that, then I don't what could be the cause... What debug steps could we follow to know more about it ? |
Once I had same issue (file not uploaded), latterly i recognized that used wrong name(imageName) in form builder. Then i replaced imageName instead of image issue was resolved. |
Actually, it works at my end, but not in all cases, See #96 (comment) |
gchokeen -> I wanna get the name of the file I'm trying to upload...not to escape and leave it empty....could you help to sort it out? |
Hi,
I am using sf 2.1. My config:
vich_uploader:
db_driver: orm
mappings:
gallery_image:
uri_prefix: /uploaded-images
upload_destination: %kernel.root_dir%/../web/uploaded-images
Entity definition: http://dpaste.com/859301/
Entity class: http://dpaste.com/859302/
Form Type: http://dpaste.com/859303/
Controller: http://dpaste.com/859304/
After form is posted I get following error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'image_name' cannot be null
So the bundle seems not to work for me. any ideas what might be wrong?
The text was updated successfully, but these errors were encountered: