Currently if you use a development or testing environment, there's no way to disable the CAPTCHA validation for that particular environment without some serious hooking.
What we need is a global variable that can be overridden in settings.php for different environments that disable CAPTCHA as a whole so that we can run automated tests that bypass captcha alltogether.
A good example of this is running end-to-end user signup tests without having to manually enter a CAPTCHA code on a testing environment.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2375745-11-skip-captcha-forms.patch | 1.01 KB | JayKandari |
#6 | captcha-2375745-6.patch | 1000 bytes | johnennew |
#5 | captcha-2375745-5.patch | 456 bytes | johnennew |
#1 | captcha-2375745-environment-specific-captcha-disabling.patch | 519 bytes | codesidekick |
Comments
Comment #1
codesidekick CreditAttribution: codesidekick commentedAttached is a patch with the global override variable.
If you'd like to disable CAPTCHA on your environment you can simply use:
in your settings.php file (or local.settings.inc file) and it will disable CAPTCHA for the given environment allowing you to run automated tests.
Note:
The captcha widget will still be displayed (useful for theming and assertions) however the validation won't take place (you can enter any or no value).
Comment #2
codesidekick CreditAttribution: codesidekick commentedComment #3
podarokCommited
Good to have a small documentation update related to this, Please do that in follow-up
Comment #5
johnennew CreditAttribution: johnennew at Deeson commentedI have found that this is not sufficient and had to add the following additional check to prevent the captcha appearing because filling in the field is sometimes still required.
Comment #6
johnennew CreditAttribution: johnennew at Deeson commentedPlease find a better patch including the requested documentation included as well.
Comment #7
dineshw CreditAttribution: dineshw as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedComment #8
Ashlesha CreditAttribution: Ashlesha commentedComment #9
dineshw CreditAttribution: dineshw as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedComment #11
JayKandariCreated a patch inspired from previous patches in this thread. Instead of skipping the whole captcha, we can allow the user to skip certain forms.
Use case: When the user wants to disable captcha on certain forms and to avoid manual deleting & recreating captcha points from the configuration page.
A form can be skipped from settings.php by adding following line.
Suggestions most welcome.
Kindly Review the patch. Thanks !!
Comment #13
seeni CreditAttribution: seeni commented#1 worked for me thanks @codesidekick
Comment #14
RgnYLDZ CreditAttribution: RgnYLDZ commentedHow can we disable captcha for a specific form like register form in D8-D9 settings.local.php?
Comment #15
super_romeo CreditAttribution: super_romeo as a volunteer commentedLike this:
$config['captcha.captcha_point.user_register_form']['status'] = FALSE;