- Category: Joomla
This is an extract from a forum which solved our problem for why the ReCaptcha part disappears from the user registration form. We have Joomla 2.5.16 installed and no new updates for a plugin that comes with Joomla 2.5 install.
Source: Joomla! • View topic - Cannot get recaptcha to display on registration form...
There are two solutions I have found that fix the problem:
I prefer this method as it changes less code and is more likely to be supported in a Joomla update. Open the file /plugins/captcha/recaptcha/recaptcha.php and find the following 3 lines of code :
const RECAPTCHA_API_SERVER = "http://api.recaptcha.net"; const RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api"; const RECAPTCHA_VERIFY_SERVER = "api-verify.recaptcha.net";and change these to
const RECAPTCHA_API_SERVER = "http://www.google.com/recaptcha/api"; const RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api"; const RECAPTCHA_VERIFY_SERVER = "api-verify.recaptcha.net";
If method #1 didn't work for you then if the following code works, it's because Google have changed where they're storing the API (again).
This overrides the Core Joomla code for ReCaptcha:
1. Open the file: /plugins/captcha/recaptcha/recaptcha.php
2. Find the following string in the OnDisplay function:
return '<div id="dynamic_recaptcha_1"></div>';3. and replace with:
- This applies to a case where the code WAS working and without any changes to the server (no updates), and the recaptcha simply stopped displaying.
- Public Key and Private Key have been setup in the Joomla Core Plugin.
- Set to display in both User Registration and Global Configuration.
- K2 is NOT installed.