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
Comments
Comment #2
ahmadhalahPlease check out this patch
Comment #3
ahmadhalahComment #4
ericvlI had the same issue. Patch in #2 solves it. Thanks
Comment #5
thetaPCPatch #2 solves it. Thank you!
Comment #6
joachim commentedWorks for me too.
(Please feel free to set an issue to RTBC if you've tested the patch and you think it fixes the problem :)
Comment #7
ojchris commentedWorks! Eliminated the error at this url http://app-d8.local/admin/config/people/captcha/examples and http://app-d8.local/admin/config/people/captcha/examples/captcha/Math
Thank you!
Comment #8
pguillard commentedRTBC++ !
Comment #9
wundo commentedComment #10
wundo commentedComment #12
wundo commentedComment #14
wheelieboy commentedPatch #2 works for me too.
Comment #15
ahmadhalah