Our website has a custom route, with a controller rendering a custom Webform. This is required, as the form has some hidden fields to be pre-populated.
Now I would like to add the CAPTCHA module to the webform. When enabling the CAPTCHA for Drupal's default contact form and viewing it in incognito mode, it works nicely. The CAPTCHA shows up.
But when adding the CAPTCHA element to the custom form, it is not displayed at all.
I've tried several ways to embed the form, but none is working:
- Embed as a Webform entity (using
getSubmissionForm(..)
) - Embed as a Webform entity (using
getViewBuilder('webform')
) - Embed as a render array with the new element type webform
Would be glad to get any info on what's wrong here?