News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Joomla 3.5 the captcha is no more visible

Started by patbe60, March 22, 2016, 13:31:46 PM

Previous topic - Next topic

patbe60

After upgrading to Joomla 3.5 the captcha is no more visible in both, user registration and ask a question.

VM 3.0.14
J 3.5.0

WebStuff

#1
Confirm this is happening on mine too same versions.
The recaptcha div is not populated.
<div id="dynamic_recaptcha_1"></div>

EDIT: If I set version to 1.0 in the plugin settings it works so obvoiusly a Version 2.0 problem.

WebStuff

#2
It works if I comment out line 63 and add the following to the else for the version check at line 61. in [ROOT]/plugins/captcha/recaptcha/recaptcha.php :
$file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag();
JHtml::_('script', $file);
//JHtml::_('script', 'plg_captcha_recaptcha/recaptcha.min.js', false, true);

$document = JFactory::getDocument();
$theme = $this->params->get('theme', 'clean');
$document->addScriptDeclaration('jQuery(document).ready(function($) {$(window).load(function() {'
. 'grecaptcha.render("' . $id . '", {sitekey: "' . $pubkey . '", theme: "' . $theme . '"});'
. '});});'
);

I assume it isn't finding plg_captcha_recaptcha/recaptcha.min.js possibly due to a wrong path?

franayala

Hi mirrorsandglass,

Works for me, but only for askaquestion, not for virtuemart registration...

Works for both things in your sites?

Thanks!
www.cuidadicos.es - Natural suplements and beauty

jenkinhill

Reports of Captcha problems elsewhere for other extensions. Seems the Joomla devs have not made the new version 2 backwards compatible.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

franayala

Back to Joomla 3.4.8 and Recaptcha not work in registration page (1.0 or 2.0).

I try with protostar and same thing...
www.cuidadicos.es - Natural suplements and beauty

WebStuff

#6
Quote from: franayala on March 24, 2016, 12:02:28 PM
Hi mirrorsandglass,

Works for me, but only for askaquestion, not for virtuemart registration...

Works for both things in your sites?

Thanks!
Hi franayala,
Yes it works for me in both askaquestion and registration.
Sorry for the obvious but make sure you have the tick box checked in Configuration/Configuration/Shop

franayala

Hi mirrorsandglass!

No worries. ;)

This option is checked, but not works for me :(

Any idea?

Thanks a lot!!
www.cuidadicos.es - Natural suplements and beauty

WebStuff

Hi franayala,
Only other things I can think of causing this problem for registration are your template, another plugin or a script conflict.
Without knowing your site it would be impossible to tell.

Try without template overrides or using just the default template.
If you have any other plugins that are used during registration try de-activating them one at a time, if you can, and see if that solves the problem.
Firebug in Firefox is great for spotting script conflicts.

Sorry I can't be more help.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

aha

Quote from: mirrorsandglass on March 23, 2016, 17:34:05 PM
Confirm this is happening on mine too same versions.
The recaptcha div is not populated.
<div id="dynamic_recaptcha_1"></div>

EDIT: If I set version to 1.0 in the plugin settings it works so obvoiusly a Version 2.0 problem.

If select the version of 1, and then somehow it works
I loaded the old file (/plugins/captcha/recaptcha/recaptcha.php), also worked in version 2.0 but with some flaws

aha

Quote from: mirrorsandglass on March 23, 2016, 17:56:13 PM
It works if I comment out line 63 and add the following to the else for the version check at line 61. in [ROOT]/plugins/captcha/recaptcha/recaptcha.php :
$file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag();
JHtml::_('script', $file);
//JHtml::_('script', 'plg_captcha_recaptcha/recaptcha.min.js', false, true);

$document = JFactory::getDocument();
$theme = $this->params->get('theme', 'clean');
$document->addScriptDeclaration('jQuery(document).ready(function($) {$(window).load(function() {'
. 'grecaptcha.render("' . $id . '", {sitekey: "' . $pubkey . '", theme: "' . $theme . '"});'
. '});});'
);

I assume it isn't finding plg_captcha_recaptcha/recaptcha.min.js possibly due to a wrong path?

Thank you.
It helped for registration form

biltong

#12
Joomla 3.5.1 has no mention of Captcha fixes.

Just tested my installation again with J3.5.1 and VM 3.0.14 on Firefox 45.0.1 with these results:

Does not show on VM 'Recommend to a friend' and 'Ask a Question' even with Beez template. When you click Submit, it displays 'The CAPTCHA solution was incorrect.'
      
Does however show and work on VM Cart / Checkout page when clicking on the Forgot Password and Forgot Username links.

jenkinhill

#13
The fix for /plugins/captcha/recaptcha/recaptcha.php enables Recaptha to work on VM and also on at least one other component that had the same problem.

Maybe easier to understand the code change here:
http://forum.joomla.org/viewtopic.php?f=710&t=874688&start=30#p3385872
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

stAn99

this forum post got the same problem:
http://www.vi-solutions.de/en/forum-index/19-joomla-extension-visforms/899-graphic-error-with-captcha-recaptcha-2-0

and the solution seems to be more elegant:


$captcha = JCaptcha::getInstance('recaptcha');
$html = $captcha->display(null, 'dynamic_recaptcha_1', 'required');


maybe wrapped with a few checks would work even better:


if (class_exists('JCaptcha') && (method_exists('JCaptcha', 'getInstance')))
   {
   $captcha = JCaptcha::getInstance('recaptcha');
   if (method_exists($captcha, 'display'))
   {
   $html_captcha = $captcha->display(null, 'dynamic_recaptcha_1', 'required');
   }
   }


best regards, stan
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart