-
- 305 Posts
I updated my FormIt to the latest version (3.0.4) and installed the ReCaptchaV2 v2.3.0 since my contact from was using Google reCAPTCHA v1. I had a notice stating this version was being discontinued. I did have a plugin for SPAM that I believe was called: PHP reCAPTCHA (or something similar) that I removed as its no longer needed.
I entered my new Google Keys and the form and Google SPAM fields show just fine. But now when I click submit, the contact form turns a white error page with these errors below instead of successfully redirecting to the success page:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in public_html/core/cache/includes/elements/modsnippet/10.include.cache.php on line 61
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /MyRoot/public_html/core/cache/includes/elements/modsnippet/10.include.cache.php on line 61
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /MyRoot/public_html/core/cache/includes/elements/modsnippet/10.include.cache.php on line 61
Parse error: syntax error, unexpected T_STRING in /MyRoot/core/cache/includes/elements/modsnippet/10.include.cache.php on line 61
The page with issue is located here:
http://www.centervillelandscape.com/contact.html
I went to: core/cache and removed the files but this issue still persists. Any ideas?
-
- 24,544 Posts
What is the snippet with the ID 10?
Can you paste the lines surrounding line 61 in this file in the core/cache directory so we can see them?
public_html/core/cache/includes/elements/modsnippet/10.include.cache.php
-
- 305 Posts
The second below line is #61 of the file you requested.
require_once($recaptchav2Path . 'autoload.php');
$recaptchav2 = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\CurlPost());
if (!($recaptchav2 instanceof \ReCaptcha\ReCaptcha)) {
$hook->addError('recaptchav2_error', $tech_err_msg);
$modx->log(modX::LOG_LEVEL_WARN, 'Failed to load recaptchav2 class.');
return false;
-
- 24,544 Posts
I'm guessing here, but try replacing the first two lines of the code above in the snippet with these three:
require_once($recaptchav2Path . 'autoload.php');
$method = new \ReCaptcha\RequestMethod\CurlPost();
$recaptchav2 = new \ReCaptcha\ReCaptcha($secret, $method);
Clear the cache before testing.
-
- 305 Posts
BobRay that is not changing anything. I am using an older version of Revo (2.2.11)and I just updated my FormIt plugin and installed new ReCaptchaV2 plus removed the PHP reCAPTCHA. So perhaps I need to update the platform. Wasn't ready to take this on today.
I did take the redirect and SPAm (plugin ReCaptcha V2) off and the issue still persists. So I am assuming my updated version of FormIt is not working properly with my older version of Revolution.
-
- 24,544 Posts
Check your version of PHP as well. The ReCaptchaV2 may require a more recent version than you have.
-
- 305 Posts
BobRay thank you for your help. Ultimately the issue was incompatibility with the core versus the addon. My core is outdated REvo v2.2 and the addon ReCaptchaV2 requires Revo v2.3x or greater. This turned out to be the issue. I had to restore my website to a previous state, and then took one step at a time testing to see where it broke. Basically when I added the snipett code from ReCaptchaV2 to my contact form, the issue resumed.
I either need to update the site to the latest version or not use ReCaptcha V2 on my outdated FormIt installation. Right now, I just removed this field and my form works great. Its time my client upgrade! Should have double checked the version number on this addon before attempting to install. Again, thank you for your help.
-
- 24,544 Posts
Be sure to upgrade to 2.3.0, 2.4.0, 2.5.0, and 2.6.0 during the upgrade process.
I'm not sure if the UpgradeMODX extra will work in 2.2, but I think it will. It will definitely work in the first version that has widget capability in the Manager. It shouldn't hurt to try and install it.
Back up the site first, and I would recommend testing each version briefly after installing it.