IphpFileStoreBundle icon indicating copy to clipboard operation
IphpFileStoreBundle copied to clipboard

Serialization is not allowed

Open syntheticsky opened this issue 12 years ago • 2 comments

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.

syntheticsky avatar Oct 04 '13 10:10 syntheticsky

Are you sure your entity is properly tagged ?

@FileStore\Uploadable for the class itself

and

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

LouTerrailloune avatar Oct 04 '13 15:10 LouTerrailloune

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.

firestorm23 avatar Dec 22 '15 13:12 firestorm23