Undefined variable type in Captcha Examples

Created on 30 October 2019, over 5 years ago
Updated 9 October 2023, over 1 year ago

Hello great community,

Problem/Motivation

I got this error when I entered into the Captcha Examples page

Notice: Undefined variable: type in Drupal\captcha\Form\CaptchaExamplesForm->buildChallenge() (line 108 of modules/contrib/captcha/src/Form/CaptchaExamplesForm.php).
  protected function buildChallenge($module, $challenge) {
    return [
      '#type' => 'captcha',
      '#captcha_type' => $module . '/' . $type,
      '#captcha_admin_mode' => TRUE,
    ];
  }

Proposed resolution

$type variable should be replaced with challenge variable

  protected function buildChallenge($module, $challenge) {
    return [
      '#type' => 'captcha',
      '#captcha_type' => $module . '/' . $challenge,
      '#captcha_admin_mode' => TRUE,
    ];
  }

Thanks

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ahmadhalah

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024