vitiko / IphpFileStoreBundle

Symfony 2 file upload for doctrine entities
http://symfonydev.ru/iphpfilestorebundle/
51 stars 23 forks source link

Serialization is not allowed #8

Open syntheticsky opened 11 years ago

syntheticsky commented 11 years ago

I have problem with file uploading. On save symfony get "Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed". I do all that written on docs.

LouTerrailloune commented 11 years ago

Are you sure your entity is properly tagged ?

@FileStore\Uploadable for the class itself

and

@FileStore\UploadableField(mapping="mapping_name") for the field.

firestorm23 commented 8 years ago

I've got same issue yesterday. It was bothering me and I had to get deeper in vendor code. I found that sometimes AnnotationDriver class don't correctly parse annotations in entity. I found that PROPERTY annotations was parsed well but CLASS annotation didn't made into loadedAnnotations - the array that doctrine forms when parses entity sources. This bug constantly occurred no matter of what entity I tried to make Uploadable. I tried it with totally new entities with clean CRUD and controllers. This bug mysteriously disappeared when I tried to add my annotations with empty rules. It worked and after that Uploadable annotation started to work again. It least I figured how to fix it, I think this is something to do with class cache or bootstrap cache. Next time I'll catch it I try to figure out what is concrete method to recreate this bug.