Comments (5)
Did you resolve this, I'm stuck on the same problem. I've followed the docs and no error is thrown for the recaptcha field.
from ewzrecaptchabundle.
Hi @radekz2, yes it should be fixed.. See #10
from ewzrecaptchabundle.
Not sure if that's related, I've tried some simple debugging and it looks like recaptcha Validator is not being called. Here's some code (thank you for your help :) ):
Form builder:
$builder->add('captcha', 'ewz_recaptcha', array("attr" => array("options" => array("theme" => "clean")), "error_bubbling" => true, "invalid_message" => "captcha.invalid", "label" => "label.captcha", "translation_domain" => "forms", 'required' => true, "mapped" => false, "constraints" => array(new True())));
Entity:
/**
* @ORM\Column(type="string", length=16)
* @Recaptcha\True
*/
protected $captcha;
from ewzrecaptchabundle.
I found the issue, validation group was not passed to the True() constraint and validator would not fire off.
True() has to be
new True(array("groups" => "validationgroupname"))
Here's the code I had to have for it to run
$builder->add('captcha', 'ewz_recaptcha', array("attr" => array("options" => array("theme" => "white")), "error_bubbling" => true, "invalid_message" => "captcha.invalid", "label" => "label.captcha", "translation_domain" => "forms", 'required' => true, "mapped" => false, "constraints" => array(new True(array("groups" => "contest")))));
Do you think it's worth updating the docs?
from ewzrecaptchabundle.
You are welcome to do a push request with your update and I'll review it
from ewzrecaptchabundle.
Related Issues (20)
- Wrong api host variable triggers error HOT 1
- Php8 support HOT 3
- Unable to use @Recapchta\IsTrueV3 annotation HOT 7
- Got 404 not found on Ajax request to https://www.google.com/recaptcha/api/js/recaptcha_ajax.js HOT 1
- Error boolean given when submitting form type constraint
- EWZRecaptchaType::RECAPTCHA_API_JS_SERVER does not exist HOT 1
- Add support for Symfony 6
- Wrong path for recaptcha.css HOT 2
- Problems with Options form
- Field not required
- IsTrueValidatorV3 is not using the ReCaptcha service HOT 2
- Having multiple forms with V3 recaptcha overwrites global js variables
- v3 recapcha should not render a label
- v3 submit javascript event never trigger HOT 1
- Strange behavior checkBox
- Add support for CSP nonces
- V3 with CSP nonce
- [Question|Issue] Bundle not triggering frontend validation
- Allow symfony 7 HOT 1
- Symfony 7.1 deprecation.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ewzrecaptchabundle.