V-labs / VlabsMediaBundle

Form, database and filesystem abstraction for files
44 stars 18 forks source link

Argument 1 passed to Vlabs\MediaBundle\EventListener\BaseFileListener::preSetData() #24

Closed Spomky closed 10 years ago

Spomky commented 10 years ago

Hi,

I have followed the documentation and I get this error:

Catchable Fatal Error: Argument 1 passed to Vlabs\MediaBundle\EventListener\BaseFileListener::preSetData() must be an instance of Symfony\Component\Form\Event\DataEvent, instance of Symfony\Component\Form\FormEvent given

I use Symfony 2.4 Any idea?

systemasis commented 10 years ago

Did you installed the version 1.1 ?

If you did so, you will have to upgrade to version 1.1.1

If not, change BaseFileListener::preSetData(DateEvent $event) in BaseFileListener::preSetData(FormEvent $event).

choomz commented 10 years ago

Hi,

As @systemasis said, you should use master or last tag 1.1.1 which are ok with last symfony version.

EnergieZ commented 10 years ago

Hi,

i still have the same problem ! I'm under symfony 2.3.13, and tried with media bundle 1.1 and 1.1.1

Her is the error :

ContextErrorException: Catchable Fatal Error: Argument 1 passed to Vlabs\MediaBundle\EventListener\BaseFileListener::preSetData() must be an instance of
 Symfony\Component\Form\Event\DataEvent, 
instance of Symfony\Component\Form\FormEvent given in /path/to/site/vendor/vlabs/media-bundle/Vlabs/MediaBundle/EventListener/BaseFileListener.php line 59

I've tried to set public function preSetData(FormEvent $event) instead of public function preSetData(DataEvent $event)

and get this error

ContextErrorException: Catchable Fatal Error: Argument 1 passed to Vlabs\MediaBundle\EventListener\BaseFileListener::preSetData() must be an instance of
 Vlabs\MediaBundle\EventListener\FormEvent, 
instance of Symfony\Component\Form\FormEvent given in /path/to/site/vendor/vlabs/media-bundle/Vlabs/MediaBundle/EventListener/BaseFileListener.php line 59

Any help is welcom. Thank you

emiljaszczuk commented 9 years ago

Hi,

I had same error. I fixed it by changing:

in file myproject/vendor/vlabs/media-bundle/Vlabs/MediaBundle/EventListener/BaseFileListener.php lines: 59 => public function preSetData(FormEvent $event)

for => public function preSetData(\Symfony\Component\Form\FormEvent $event) "don't forget \ before Symfony"

and 80 => public function bind(DataEvent $event)

for => public function bind(\Symfony\Component\Form\FormEvent $event)

After that everything started to work perfectly