- πΊπΈUnited States jumpsuitgreen
I had custom Webforms that weren't working on a site with the Antibot module enabled and protection enabled in the Webforms settings. Once I included
{{ element.antibot_no_js }}{{ element.antibot_key }}
in the form Twig template, everything worked fine. I only needed to include it once in the template and I did so at the very bottom with some of the other hidden fields likeform_token
andform_id
. This bit of information is no where in the documentation unless I missed it somewhere. Preferably, the module page and the README file. Here is what my block looks like the the bottom of the webform Twig template:<div class="row"> <div class="col-md-2 offset-md-1 offset-lg-2"> {{ element.elements.message }} {{ element.elements.url_redirection }} {{ element.form_build_id }} {{ element.form_token }} {{ element.form_id }} {{ element.elements.actions }} # Antibot keys to render. {{ element.antibot_no_js }} {{ element.antibot_key }} </div> </div> </div> </form>
#18 Worked for my custom forms! Thank you very much jumpsuitgreen! Pretty incredible that this solution was posted at the exact time as I was having the problem.
- πΊπΈUnited States ronalpha
form_id was returning null or empty when executing form validation logic.
This code_antibot_generate_key($form['#form_id']);
in antibot.moduleChanged to
_antibot_generate_key($form_state->getValue('form_id'));
Now the form_id is returning the correct value and the form is processed with no antibot related errors.