Closed lokamaya closed 5 years ago
I have the error-message "formit could not load Formit/Recaptcha service class" on/in my website, and found your solution, but when I changed the file ( /core/components/formit/src/FormIt.php) with your suggestion I had to leave the manager. When I wanted to load the manager again I got a blank screen, even after deleting the cache etc. So I changed formit.php back to the old version, there was my manager login again. So what's the right solution of the error that formit can't load the recaptchav2 service class. (modx 2.6.5, php 7.0.3) I'm curious to know.
Got the same errormessage in my errorlog. I can confirm that this code adaptation works.
I've tried updating the code per the thread on the forum, and it did NOT work for me. I've had to just disable the recaptchav2 hook, until such time as this plugin is updated and it works.
I refactored a lot in 4.2.0, and included this fix manually. So I close this PR.
(boolean) function hasHook()
Using strpos() to evaluate hooks is very unreliable, as it is prone to hook collision. For example when using ReCaptchaV2 as hooks, its generates an error because FormIt automatically tries to load the ReCaptcha class.
See MODx Forum thread/103830