Topic-icon reCaptcha and K2

Active Subscriptions:

None
11 years 11 months ago #44681 by jchungerford
I am having an issue with the reCaptcha trying to re-declare its class through K2 during new user registration through JFBConnect. It's weird because this was working fine not too long ago. :/

I get the following error:

Notice: Constant RECAPTCHA_API_SERVER already defined in /var/www/osl/administrator/components/com_k2/lib/recaptchalib.php on line 49

Notice: Constant RECAPTCHA_API_SECURE_SERVER already defined in /var/www/osl/administrator/components/com_k2/lib/recaptchalib.php on line 50

Notice: Constant RECAPTCHA_VERIFY_SERVER already defined in /var/www/osl/administrator/components/com_k2/lib/recaptchalib.php on line 51

Fatal error: Cannot redeclare class ReCaptchaResponse in /var/www/osl/administrator/components/com_k2/lib/recaptchalib.php on line 148


Here are lines 49, 50, 51, & 148 on the php file:


47 * The reCAPTCHA server URL's
48 */
49 define("RECAPTCHA_API_SERVER", "www.google.com/recaptcha/api");
50 define("RECAPTCHA_API_SECURE_SERVER", "www.google.com/recaptcha/api");
51 define("RECAPTCHA_VERIFY_SERVER", "www.google.com");


148 class ReCaptchaResponse {
149 var $is_valid;
150 var $error;
151 }


I'm using J 3.3.0 | Jomsocial 3.2.0.5 | JFBConnect 6.0.6 (System is 6.0.4) | SCLogin 4.0.6

Automatic Registration is OFF.

K2 settings with Joomla should be as follows:

- Goto Joomla Admin > Plug-in Manager > Captcha - ReCaptcha and enter your Keys and ENABLE Plug-in.
- Goto Joomla Admin > Global Configuration > Default Captcha and set it to use "Captcha - ReCaptcha".
- Goto Joomla Admin > Components > K2 > Parameters > Comments > Anti-spam protection and set it to use "Google reCaptcha" (or Both), plus ENABLE "reCaptcha for registered users".
- Goto Joomla Admin > Components > K2 > Parameters > Advanced > down to "Anti-spam Settings" and enter your Keys again, plus set "Enable reCaptcha on registration form" to YES.

A conflict with the default reCaptcha in Joomla vs. K2. The answer to get it to work is this ...

- Goto Joomla Admin > User Manager > Options (button) > Captcha and set it to use "NONE". This will turn-off the default user registration reCaptcha loading in the background behind K2 and causing the conflict.


I've disabled several plugins and tested after clearing server and browser caches. I've done the following:

Disabled - JCH Optimize Pro plugin
Disabled - NoNumber CDN for Joomla plugin
Disabled - Captcha reCaptcha plugin
Disabled - K2 Social Profiles plugin
Disabled - System Cache

After doing the above it still returns the same errors. Could the ordering of the plugins be causing this issue?

I am at a loss. :(
The topic has been locked.
Active Subscriptions:

None
11 years 11 months ago #44688 by jchungerford
Replied by jchungerford on topic reCaptcha and K2
Just disregard this thread. It appears that the Jomsocial reCaptcha takes precedence in the new account registration and K2 anti-spam setting (in Advanced Tab) was on for registration as well. I just disabled the K2 reCaptcha setting for registration and it works again.

Conflict solved as no members will be registering directly through K2 extension on front end anyways.
The topic has been locked.
Support Specialist
11 years 11 months ago #44691 by alzander
Replied by alzander on topic reCaptcha and K2
Glad you found a solution that worked for you. I was a bit lost and confused as to what the issue was and how we could fix it within JFBConnect.. so I'm happy we don't have to :)

Of course, if you run into any issues or have any other questions, just let me know.

Thanks,
Alex
The topic has been locked.