Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on hasHook() #181

Closed
wants to merge 1 commit into from
Closed

Bug on hasHook() #181

wants to merge 1 commit into from

Conversation

lokamaya
Copy link

(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

(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.
@lokamaya lokamaya changed the title Bug on strpos Bug on hasHook() Jul 25, 2018
@Margootje
Copy link

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.

@mintnl
Copy link

mintnl commented Aug 8, 2018

Got the same errormessage in my errorlog.
I can confirm that this code adaptation works.

@jacobkball
Copy link

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.

@sdrenth sdrenth mentioned this pull request Jan 30, 2019
@Oetzie
Copy link

Oetzie commented Feb 15, 2019

I refactored a lot in 4.2.0, and included this fix manually. So I close this PR.

@Oetzie Oetzie closed this Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants