Can't apply captcha to views forms by base form id

Created on 27 August 2025, 2 months ago

Problem/Motivation

Trying to apply a captcha to the Cart form in commerce doesn't work, the form id is dynamic and we can't apply by form id because the views form is not an instance of BaseFormIdInterface, while still has a getBaseFormId() method.

Steps to reproduce

Try to apply captcha to the cart form using the base form id (views_form_commerce_cart_form_default).

Proposed resolution

Instead of checking if the form is a instance of BaseFormIdInterface, just check if the method exists in the form.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇧🇷Brazil joao sausen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024