Rework the "default_validation" config (CAPTCHA_DEFAULT_VALIDATION_CASE_)

Created on 7 June 2023, over 1 year ago
Updated 14 June 2023, over 1 year ago

Problem/Motivation

Currently, the "default_validation" can be used by any submodule to enable their own custom validation. The problem is, that in code and on the UI this isn't completely clear. The only hint, that this is overridable or can be ignored, by each submodule is coming from the description:

Define how the response should be processed by default. Note that the modules that provide the actual challenges can override or ignore this.

The problem is that the selectable options are the following:

'#options' => [
        CaptchaConstants::CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE => $this->t('Case sensitive validation: the response has to exactly match the solution.'),
        CaptchaConstants::CAPTCHA_DEFAULT_VALIDATION_CASE_INSENSITIVE => $this->t('Case insensitive validation: lowercase/uppercase errors are ignored.'),
      ],

This makes the option way too specific and not even appliable to the core "MATH" captcha (as this captcha type doesn't need the upper / lower case validation).

Steps to reproduce

Proposed resolution

We should either make the options more generic (CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE is just a 0 integer). Or dynamically change the description of the options based on the currently set default captcha.

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany Grevil

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

Comments & Activities

  • Issue created by @Grevil
  • Status changed to Postponed over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Totally agree, we already had that point, but I think this won't be solvable in 2.x without a breaking change to the whole module logic.

    Indeed not all captcha types need this option and if they need it, it would be expected, to have it in their settings. Like we saw im modules like Ridler, nobody expects this in the global CAPTCHA settings. So this is bad UX and not perfectly fitting all cases in general.

    As this is something that can't be solved in the near future, I'm changing this to a Plan and postponed.

  • Status changed to Active over 1 year ago
  • 🇩🇪Germany Grevil

    Nope, this won't be a breaking change. The constants simply have the values 0 and 1, we can simply adjust the text, create new constants with the exact same values and keep the old constants for other modules to still use (Although we should flag them as deprecated).

Production build 0.71.5 2024