Problem/Motivation

Currently CAPTCHA 2.x uses a structure like this for the description:

<fieldset data-drupal-selector="edit-captcha" class="captcha captcha-type-challenge--recaptcha">
  <div class="captcha__description">This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.</div>
  <div class="captcha__element">
    <input data-drupal-selector="edit-captcha-sid" type="hidden" name="captcha_sid" value="yyy">
    <input data-drupal-selector="edit-captcha-token" type="hidden" name="captcha_token" value="xxx">
    ...
  </div>
</fieldset>

but instead it seems it would make more sense to perhaps use the same structure as Drupal uses for form fields with

  • label
  • div.description

so that the default style applies.

A good example is the login form: /user/login which currently looks like this, (if no label is used):

I'd instead expect the long text as description and the label (if set) as label.

We should hurry up to improve this, as long as 2.x isn't that widely used. It will be a BC anyway, but won't hurt that much, if we do it early.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
login-form-captcha.png28.07 KBAnybody

Issue fork captcha-3357694

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anybody created an issue. See original summary.

Anybody’s picture

Issue summary: View changes

Anybody’s picture

Status: Active » Needs review
Anybody’s picture

I think this default makes most sense :)
If anyone needs custom solutions, it can be overwritten. But this way the default style applies. What do you think @thomas.frobieter?

thomas.frobieter’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, its okay for me

thomas.frobieter’s picture

Status: Reviewed & tested by the community » Fixed
Anybody’s picture

Assigned: thomas.frobieter » Unassigned

Works super great, thank you! :)

Anybody’s picture

Status: Fixed » Needs work

-.- forgot to fix the tests accordingly! I'll do that now.

  • Anybody committed 7a130789 on 2.x
    Fix tests from Issue #3357694: Use label...
Anybody’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.