Skip to content
Advertisement

why cannot I delete my image entity using VichUploader?

I work with Symfony 4 and Doctrine And i’m using VichUploader to manage my images.

I create an entity image and when I use this entity to add new images it works like a charm but when I want to delete it with my controller :

JavaScript

I get the strangest error :

JavaScript

with `filename being as such in my Image entity :

JavaScript

The same behavior appear when dealing with editing the entity. Do you see anything that I did wrong?

Advertisement

Answer

It looks like you’re using a type hinting on your setter, something like

JavaScript

You need to use a less strict type, like this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement