Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cannot delete media from Entity #154

Closed
thomas2411 opened this Issue · 2 comments

2 participants

@thomas2411

If I have an Entity with some media attached, it is not possible to just delete this media. So scenario: edit Entity Object, click remove media button and save Entity throws and error:

Catchable Fatal Error: Argument 1 passed to MyBundle\Entity\Okladka::setMedia() 
must be an instance of Application\Sonata\MediaBundle\Entity\Media, null given, 
called in D:\wamp\www\fs\vendor\symfony\src\Symfony\Component\Form\Util\PropertyPath.php 
on line 347 and defined in D:\wamp\www\fs\src\MyBundle\Entity\Cover.php line 292 
@rande
Owner

you need to add =null in the Okladka::setMedia method signature

@rande rande closed this
@thomas2411

Works like a charm...Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.