?
Referenced as Pull Request for: # 7210
avatar mepsteinj
mepsteinj
6 Apr 2015

Steps to reproduce the issue

Create two captcha fields in the same page through a form with type="captcha" (I use different "namespace" for each field)

Expected result

Two captcha in the same page.

Actual result

Error: reCAPTCHA plugin needs a site key to be set in its parameters. Please contact a site administrator.

System information (as much as possible)

Joomla 3.4.1

Additional comments

The fist time the captcha plugin is loaded, the _load function in the captcha library convert the plugin params from string to a Registry object, this is correct, but the second time the plugin is loaded, the library put the already converted params inside a new Registry object and the plugin params can't be used anymore.

File: libraries/cms/captcha/captcha.php
Line: 233

This issue can be fixed by checking if the plugin params is already a JRegistry object.

if (!($plugin->params instanceof JRegistry))
{
$params = new Registry($plugin->params);
$plugin->params = $params;
}

Please note. With the current version of Recaptcha (reCAPTCHA API version 2.0), you can have multiple recaptchas on one page, and this is the first step to achieve this feature.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar mepsteinj mepsteinj - open - 6 Apr 2015
avatar mepsteinj mepsteinj - change - 6 Apr 2015
Labels Removed: ?
avatar brianteeman brianteeman - change - 6 Apr 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 17 Jun 2015

@nikosdion any thoughts on this


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6674.

avatar nikosdion
nikosdion - comment - 18 Jun 2015

Good morning. I'm afraid I didn't write this plugin :( The plugin was written by @nonumber. It eventually became out of sync with the Joomla! development branch because it took too long to be merged. Since Peter had no time to make the code mergeable, the deadline for the release was looming and I had half a day to spare I stepped in and made the barely minimum changes to make the reCAPTCHA plugin mergeable into the staging branch. I have no idea how the plugin really works.

avatar brianteeman
brianteeman - comment - 18 Jun 2015

ah - my memory failed me @nikosdion

@nonumber any thoughts on this issue?

avatar Bakual
Bakual - comment - 18 Jun 2015

@mepsteinj Since you already have a code proposed, do you want to create a PR so your suggestion can be tested?
See https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests for how to do it using the GitHub UI.

avatar mepsteinj
mepsteinj - comment - 19 Jun 2015

@Bakual Done, as requested.

avatar zero-24
zero-24 - comment - 19 Jun 2015

Closing as we have a pull #7210 Thanks :smile:

avatar zero-24 zero-24 - change - 19 Jun 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-06-19 19:50:43
Closed_By zero-24
Build master staging
avatar zero-24 zero-24 - close - 19 Jun 2015

Add a Comment

Login with GitHub to post a comment