AI-assisted by Codex. (review by jrockowitz)

Problem/Motivation

CAPTCHA 2.0.12 places the CAPTCHA administration helper under $form['elements']['captcha'], just before the webform actions. Webform's after-build callback only checks $form['captcha']['add_captcha'], so it returns early with the new placement and does not update the administration helper text and links.

Steps to reproduce

  1. Use Webform 6.3.x with CAPTCHA 2.0.12 and Image CAPTCHA enabled.
  2. Enable CAPTCHA administration mode.
  3. Visit a webform with a CAPTCHA element and a webform without one.
  4. Check whether the CAPTCHA administration helper text and links are updated.

Proposed resolution

Support both CAPTCHA form placements in third_party_settings/webform.captcha.inc, retaining compatibility with older CAPTCHA versions.

Remaining tasks

Review the proposed fix and run the CAPTCHA functional test.

User interface changes

None.

API changes

None.

Data model changes

None.

Test

WebformElementCaptchaTest passes on the updated 6.3.x checkout: 1 test, 4 assertions, no failures. PHPUnit reported 121 deprecations and 2 PHPUnit deprecations.

Issue fork webform-3635533

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

jrockowitz created an issue. See original summary.

jrockowitz’s picture

AI-assisted by Codex (reviewed by jrockowitz)

From Codex

I reviewed MR !974 locally against Webform 6.2.x.

Webform 6.2.x is also impacted by CAPTCHA 2.0.12. Its after-build callback checks only `$form['captcha']['add_captcha']`, while CAPTCHA 2.0.12 places the administration helper under `$form['elements']['captcha']`.

Commit `f949cd747` applies cleanly to current `origin/6.2.x` with no conflicts. The resulting callback matches the 6.3.x fix, and both `php -l` and `git diff --check` pass.

The existing functional test could not complete locally because the Webform 6.2.x PHPUnit 9 stack treats PHP 8.5 PDO deprecations as errors before any assertions run.

  • jrockowitz committed 00580ddb on 6.3.x
    Issue #3635533 by jrockowitz: Support CAPTCHA 2.0.12 placement
    

  • 363cc35f committed on 6.2.x
    fix: #3635533 Support CAPTCHA 2.0.12 placement
    
    By: jrockowitz
    
    AI-...
jrockowitz’s picture

Status: Active » 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.

  • jrockowitz committed 00580ddb on 6.x
    Issue #3635533 by jrockowitz: Support CAPTCHA 2.0.12 placement