Closed janwidmer closed 5 years ago
Hi @janwidmer glad you like it. Does the validation error show if you use the placeholder without any filters? Only:
[[!+fi.error.recaptchav2_error]]
Also you don’t have to add it to the FormIt validators: it’s always required. In fact try if removing it from the validation helps with the issue.
Also looks like you’re doing this inside another Snippet. Without seeing what that Snippet is doing I can’t be certain of how the placeholders and hook execution might be affected
I removed it from the validators and also removed the filter, but I still don't get any errors.. In the modx logs, I get the following entry, no matter if I solve the captcha before submitting or not..
Could not load FormItReCaptcha service class.
I am using a pattern setup where I am using a snippet and a chunk for every pattern. The snippet contains the above logic and the call to the chunk:
$scriptProperties = array();
$scriptProperties['hooks'] = 'recaptchav2,email';
$modx->runSnippet('FormIt', $scriptProperties);
$output = $modx->getChunk('mod-form',array());
return $output;
Of course, that could have something to do with it, but all other formit things work perfectly including custom hooks..
Oh! That is a current bug in FormIt: it does a strpos
check for “recaptcha” in the hooks and if so, attempts to load the legacy recaptcha that was built into FormIt.
There’s a hotfix for it somewhere...
Which version of FormIt are you using?
I just upgraded to FormIt version 4.1.1
It's a known issue at FormIt. See:
@janwidmer you can copy the hotfix from that FormIt PR referenced above into the file in your install.
(good idea to backup the filesystem before making such changes in core/
)
@sepiariver and that known issue will also fix the validation message not being displayed?
Yes @janwidmer because currently FormIt is trying to load the legacy built-in recaptcha class and throwing an error. This message Could not load FormItReCaptcha service class.
is not from the RecaptchaV2 Extra, it's from FormIt.
ah ok thanks :-)
Hey..I am sorry to bring this up again..I just updated to the newest FormIt Version 4.2.1 which includes the fix for the ticket you mentioned above.. I am running on recaptchav2 Plugin Version 3.0.1-rc1, but that did not fix my problem..the error message in the log is gone, but I still do not get a validation message when not solving the captcha..
I created a very simple test case which just contains the below code directly in the content field of a test page (without using my pattern framework). You can see the page here: https://www.widmer-web.ch/test-page.html
[[!FormIt?
&hooks=`recaptchav2`
&validate=`test:required`
]]
<form action="[[~[[*id]]]]" method="post" id="test-form">
<label for="test">Test Field</label>
<input type="text" value="[[!+fi.test]]" name="test" id="test" />
[[!+fi.error.test]]
[[!recaptchav2_render]]
[[!+fi.error.recaptchav2_error]]
<button type="submit">Submit Form</button>
</form>
As you can see when submitting, the error message of the required test field gets outputtet, but no recaptcha error message..
any idea, what I am doing wrong?
ok seems to work now.
Hi there, I just installed your addon and it works very well, thank you! One thing that I noticed is, that I never get the validation message when I do not solve the captcha.
My settings:
My Form Logic:
My Form Template:
Any idea what I am doing wrong?