News:

Looking for documentation? Take a look on our wiki

Main Menu

recaptcha wasnt rendering

Started by PRO, June 24, 2026, 20:19:56 PM

Previous topic - Next topic

PRO

Captcha field was failing to render , was wrapped in editor html, the onInit, and onDisplay was causing this.

shopfunctionsF


comment these out
            //   $app = JFactory::getApplication();
            //   $results = $app->triggerEvent('onInit', [$id]);
            //   $output  = $app->triggerEvent('onDisplay', [$reCaptchaName, $id, 'g-recaptcha required']);



and added
   $captcha = \Joomla\CMS\Captcha\Captcha::getInstance($reCaptchaName);
    $output = [$captcha->display($id, $id, 'g-recaptcha required')];



so fixed as so

   } else {
            //   $app = JFactory::getApplication();
            //   $results = $app->triggerEvent('onInit', [$id]);
            //   $output  = $app->triggerEvent('onDisplay', [$reCaptchaName, $id, 'g-recaptcha required']);
            $captcha = \Joomla\CMS\Captcha\Captcha::getInstance($reCaptchaName);
    $output = [$captcha->display($id, $id, 'g-recaptcha required')];
            }