text 在Formit Modx中混合van RechaptchaV2的Oplossing错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 在Formit Modx中混合van RechaptchaV2的Oplossing错误相关的知识,希望对你有一定的参考价值。

Edited the code just a pinch like so in the file /core/components/formit/src/FormIt/Request.php:
Line 81 and 82 become this:
/* check for recaptchv2 first, so let's add a NOT case to the recaptcha check for
anything that looks like recaptchav2, and if it is such, not proecess,
allowing helper plugins to do their magic
IE: https://github.com/sepiariver/recaptchav2
if using recaptcha, load recaptcha html */
if ($this->formit->hasHook('recaptcha') && !($this->formit->hasHook('recaptchav2'))) {
Now line 81 to 86 in my file. (milage may differ if you scrunch some lines)
This did the trick for getting recaptchav2 working again with secondary plugin from here:
Recaptchav2
If anyone wants to give me tips on submitting this as a possible PR to Sterc would not mind.

PS Really just change line 82 in original from:
if ($this->formit->hasHook('recaptcha')) {
Into this:
if ($this->formit->hasHook('recaptcha') && !($this->formit->hasHook('recaptchav2'))) {
which is just checking for 'recaptchav2', and not triggering the if statement if the hook is 'recaptchav2' and only tiggers for 'recaptcha'. E.G. if recaptcha in hooks, but NOT recaptchav2 in hooks, then proceed with recaptcha process.

以上是关于text 在Formit Modx中混合van RechaptchaV2的Oplossing错误的主要内容,如果未能解决你的问题,请参考以下文章

text Modx友好URL设置

text 单选列表框Modx migx

html FormIT和Bootstrap

MODX 进化。是不是可以在模板中获取模板变量 ID?

html ЗащитаотстамаMODXeForm和FormIt

C#混合R语言编程之RDotNet-基础