Problem/Motivation

When you set up your captcha field in webform and fill "Question title" then math captcha does not work caused by #3221197: Captcha Math question needs to be more accessible

Steps to reproduce

  • Add math captcha to a webform
  • Add field label into "Question title" field

If you leave Question title field empty then captcha works.

Proposed resolution

  1. Update hook to empty the captcha titles on all math captchas in webforms
  2. Prevent captcha titles to be set from the UI if captcha is math captcha

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork captcha-3546698

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lamp5 created an issue. See original summary.

lamp5’s picture

Title: Math captcha does not working with webform after update to 2.0.9 » Math captcha does not work with webform after update to 2.0.9
santanu mondal’s picture

Assigned: Unassigned » santanu mondal
santanu mondal’s picture

Assigned: santanu mondal » Unassigned
fanton’s picture

The problem occurs because the math question is now in the title, so overwriting it from the webform's captcha field causes the question to be lost.
See https://www.drupal.org/project/captcha/issues/3221197#comment-15298026

lamp5’s picture

@fanton, I know, I liked this issue...

sapetm’s picture

@fanton We're also experiencing this issue in version 2.0.10. I understand the root of the issue, but is there a plan for providing any documentation on how to format the Question title so that it can be appropriately localized while still displaying the math equation?

norman.lol’s picture

Version: 2.0.9 » 2.x-dev

Translate as regular under /admin/config/regional/translate. Search for "Math question".

norman.lol’s picture

Let's add an update hook at least running through all webforms (if any) and emptying the math captcha titles.

norman.lol’s picture

Status: Active » Needs review
norman.lol’s picture

It would be more bullet proof if we could find a way to prevent the title from being set in the UI in the first place.

norman.lol’s picture

Issue summary: View changes

japerry made their first commit to this issue’s fork.

japerry’s picture

So at first, was going to say this needs to change in webform -- but they didn't break the contract, we did. Closing MR !134 as it would break things downstream.

The new MR fixes it in CAPTCHA, without undoing the accessibility fix. When the response field's title is no longer the one CAPTCHA generated, the sum is rendered as a field prefix and added to the input's aria-describedby, so it stays visible and is announced. Math challenges whose title hasn't been replaced render exactly as before, so existing translations of "Math question (@x + @y =)" keep working. A new functional test mimics Webform's override.

norman.lol’s picture

Uh that's a nice idea 💡

  • japerry committed 71d6942c on 2.x
    fix: #3546698 Keep the Math CAPTCHA question visible when its title is...
japerry’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.