Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Spomky opened this issue Dec 17, 2013 · 4 comments

Comments

@Spomky
Copy link

Spomky commented Dec 17, 2013

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
Copy link
Contributor

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
Copy link
Member

choomz commented Dec 31, 2013

Hi,

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

@choomz choomz closed this as completed Dec 31, 2013
@EnergieZ
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants