Closed nicolasmahler-fr closed 3 years ago
That makes sense. I'll take a look tomorrow. You can send a pull request if you want
@nicolasmahler-fr Can you please try this PR using the following command and see if it works?
composer require "karser/karser-recaptcha3-bundle:dev-validator-alias"
Thanks for your fast reply!
It didn't work. So I tried it in a fresh install, and everything works as expected. Then i remove this version, to test the regular one.
composer remove "karser/karser-recaptcha3-bundle:dev-validator-alias"
Did install the regular package :
composer require karser/karser-recaptcha3-bundle
And finally same problem occurs : Cannot autowire argument $recaptcha of "App\Controller\ContactController::index()": it references class "Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3Validator" but no such service exists. You should maybe alias this class to the existing "karser_recaptcha3.validator" service.
It seems like there's a problem when you remove then reinstall the package (?)
[EDIT] I did remove the regular package once again, to reinstall "karser/karser-recaptcha3-bundle:dev-validator-alias" one. There's no more the class error, but the captcha is not populated in the form.
There's no more the class error
I merged the PR, so you can reinstall the package the regular way: composer require karser/karser-recaptcha3-bundle
.
but the captcha is not populated in the form.
It only adds an alias, so please try again. If it worked before it will work now.
I can confirm that it works like a charm right now!
Thanks
Awesome!
Hi,
Thanks for your work. I've been able to make it work one time but since it throw an error while trying to reach the form page :
Cannot autowire argument $recaptcha of "App\Controller\ContactController::index()": it references class "Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3Validator" but no such service exists. You should maybe alias this class to the existing "karser_recaptcha3.validator" service.
Controller looks like that :
use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3Validator;
class ContactController extends AbstractController { /**
@Route("/contact", name="contact") */ public function index(Request $request, MailerInterface $mailer, Recaptcha3Validator $recaptcha): Response {
...
Symfony 5.2.3 Php : 7.4.15
Any thoughts?
Thanks :)