IlyaPokamestov / DSReCaptchaBundle

Google ReCAPTCHA API ver.2 for Symfony2
MIT License
6 stars 6 forks source link

ClassNotFoundException when adding captcha to FormBuilder #2

Closed plaberinto closed 9 years ago

plaberinto commented 9 years ago

Hello.

I get a ClassNotFoundException when adding ->add('captcha', 'ds_re_captcha', array('mapped' => false)) inside the buildForm method. The complete message is:

Attempted to load class "ReCaptchaType" from namespace "DS\Component\ReCaptcha\Form". Did you forget a "use" statement for another namespace?

Can you help me? Thanks

plaberinto commented 9 years ago

Ok, I found the bug. The Resources/config/services.yml is wrong. Te classes should be:

DS\Component\ReCaptchaValidator\ReCaptchaValidator

and

DS\Component\ReCaptchaValidator\Form\ReCaptchaType

Fixing this, it works

plaberinto commented 9 years ago

Sorry, I made a mistake. The correct classes are:

DS\Component\ReCaptchaValidator\Validator\ReCaptchaValidator

and

DS\Component\ReCaptchaValidator\Form\ReCaptchaType

IlyaPokamestov commented 9 years ago

@plaberinto I'm sorry, I will not be available until June. I plan to continue working on the bundle after returning. Can you create PR for this issue?

plaberinto commented 9 years ago

Hello.

Well, it's not the only issue en version 2.6 of Symfony. It dosn't work because of the CSRF protection, trying to get the value of the form field "g-recaptcha-response", generated by the js of reCaptcha. I'm working on it.

2015-04-19 14:16 GMT+02:00 Ilya Pokamestov notifications@github.com:

@plaberinto https://github.com/plaberinto I'm sorry, I will not be available until June. I plan to continue working on the bundle after returning. Can you create PR for this issue?

— Reply to this email directly or view it on GitHub https://github.com/DarioSwain/DSReCaptchaBundle/issues/2#issuecomment-94270544 .

IlyaPokamestov commented 9 years ago

Hi @plaberinto! I check this issue and don't found any problems:( I reproduce all steps on Symfony 2.6.9 and CSRF protection work fine for me.

Can you get more info for this issue?

IlyaPokamestov commented 9 years ago

@plaberinto please reopen this issue if you can reproduce this.