ihqs / ContactBundle

This is a Contact Bundle built on the Observer Pattern. Plug any listener you want to your contact form in a really simple way and flexible way
http://ihqs.net
25 stars 15 forks source link

ScopeWideningInjectionException when configuring spam detection #15

Open lightdiff opened 12 years ago

lightdiff commented 12 years ago

Hi, I'm trying to configure spam detection with OrnicarAkismetBundle according to the ContactBundle documentation, but I receive the following error:

ScopeWideningInjectionException: Scope Widening Injection detected: The definition "ihqs_contact.connectors.database.event_listener" references the service "ornicar_akismet.akismet_real" which belongs to a narrower scope. Generally, it is safer to either move "ihqs_contact.connectors.database.event_listener" to scope "request" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "ornicar_akismet.akismet_real" each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.

I'm using Symfony 2.0.17 and OrnicarAkismetBundle master.

I've searched for solutions, but could do with some pointers/advice on resolving this issue.

Thanks