Recaptcha error - ReCaptcha\ReCaptcha Class not found
Hello,
Okay first off this is running on localhost so I get a javascript alert: Cannot contact reCAPTCHA. Check your connection and try again.
Now, if I complete the form; ignoring the Recaptcha and hit submit I get the following error. Where can I find the Recaptcha Class?
-------
( ! ) Fatal error: Class 'ReCaptcha\ReCaptcha' not found in /vagrant/html/local.fuel.co.uk/fuel/modules/forms/helpers/forms_helper.php on line 148
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /vagrant/html/local.fuel.co.uk/fuel/modules/forms/helpers/forms_helper.php:148)
Filename: core/Common.php
Line Number: 578
Backtrace:
A PHP Error was encountered
Severity: Error
Message: Class 'ReCaptcha\ReCaptcha' not found
Filename: helpers/forms_helper.php
Line Number: 148
Backtrace
Comments
https://github.com/daylightstudio/FUEL-CMS-Forms-Module/issues/13
https://github.com/daylightstudio/FUEL-CMS-Forms-Module/pull/15
Sounds like you'll need the vendor package installed with composer.
The next problem is that if I complete the form, but ignore the Recaptcha I can still submit the form! How do I tell Fuel/CodeIgniter that the Recaptcha is mandatory?
$validator->add_rule("recaptcha_response_field", "validate_recaptcha", "'.$params['error_message'].'", array("'.$params['recaptcha_private_key'].'"));
The "validate_recaptcha" is a function that is in the forms_helper.php file and will return a TRUE boolean value if it is valid. My guess is that there needs to be some adjustment there.