Quote from: mediengaarage at Jan 13, 2018, 09:01 AMIs there no way to integrate the extra RecaptchaV2 as preHooks, as it does with formit?
https://modx.com/extras/package/recaptchav2
I'm afraid there is none. At least nothing that could be called "official". But the changelog says: "New in 2.0.0 [...] [#3519] Add pre and post Hooks to Quip".
I can answer only one part of the question above, and am working on the actual reality of switching Quip to use recaptchav2.
As noted, first install the RecaptchaV2 package. Then add your new Recaptcha api v2 public and private keys to the RecaptchaV2 settings. You got those from your google account:
https://www.google.com/recaptcha/admin
To add to template for Quip:
[[!recaptchav2_render]]
Note the ! which the poster had left off.
This will make the recaptcha box appear, but so far I have not been able to get any further due to a complete lack of documentation about recaptcha and quip.
In the main quip chunk, I have:
[[!Quip? &thread=`thread-[[*id]]` &threaded=`0` &useGravatar=`0` &tplComment=`tplQuipComment` &useCss=`0`]] [[$quip-top-1]] [[!QuipReply? &thread=`thread-[[*id]]` &useGravatar=`0` &tplAddComment=`tplQuipAddComment` &recaptcha=`1` &disableRecaptchaWhenLoggedIn=`0` &autoConvertLinks=`0` &moderate=`1` &closeAfter=`0` ]]
However this does NOT appear to have any connection the recaptcha v2, it's the old recaptcha, which have settings as well in the settings manager.
The Quip doc page has no reference to the recaptcha v2 at all:
https://docs.modx.com/extras/revo/quip
https://modx.com/extras/package/recaptchav2
So I think maybe it's time to update the docs here so that we can fairly easily figure out how to upgrade quip to using recaptcha v2.
I've been experimenting here a bit, but as far as I can tell so far, while you can get the recaptchav2 box to appear and function superficially, so far I've found no way to make the recaptcha actually work in terms of showing the error messages and blocking form submit. In fact, form submit doesn't work at all in my tests.
I may be missing some key error messages due to the total absence of docs however.
[Update:] Because Quip simply does not work so far with RecaptchaV2 plugin, I've rolled it back to use v1, but given v1 expires on March 31, 2018, I'd say it's reasonably pressing to get the docs updated, and make sure these things all work together. Or switch the internal modx stuff to use recaptcha v2, not sure how those things hang together.
<html> <head> <title>reCAPTCHA demo: Simple page</title> <script src="https://www.google.com/recaptcha/api.js" async defer></script> </head> <body> <form action="?" method="POST"> <div class="g-recaptcha" data-sitekey="your_site_key"></div> <br/> <input type="submit" value="Submit"> </form> </body> </html>
What's the issue with just using it out of the box as its intended to be used?
https://developers.google.com/recaptcha/docs/display
That's the problem. It doesn't work out of the box.
When i put the recaptchaV2 in the addCommentTpl then you can send the form without the right captcha.
Perhaps there should be a callback?
<title>reCAPTCHA demo: Simple page</title> <script src="https://www.google.com/recaptcha/api.js" async="" defer=""></script> <form action="?" method="POST"> <div class="g-recaptcha" data-sitekey="your_site_key"></div> <input value="Submit" type="submit"> </form>
For the usage of recaptchaV2 you need: &hooks=`recaptchav2`
I think in quip there is no possibility of hooks, is it?