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

Custom validator messages not showing #273

Open
Ruslan-Aleev opened this issue Aug 8, 2022 · 0 comments
Open

Custom validator messages not showing #273

Ruslan-Aleev opened this issue Aug 8, 2022 · 0 comments

Comments

@Ruslan-Aleev
Copy link

Ruslan-Aleev commented Aug 8, 2022

Bug report

Summary

The documentation (https://docs.modx.com/current/en/extras/formit/formit.validators#custom-validators) has an example of a custom validator:

<?php
$value = (float)$value;
$success = $value > 1000;
if (!$success) {
    // Note how we can add an error to the field here.
    $validator->addError($key,'Not big enough!');
}
return $success;

But when trying to display an error message about the custom validator, nothing is displayed.

[[!+fi.error.fieldName]] (fieldName is the field for validation) returns nothing.
At the same time, the messages of standard validators are displayed normally.

Moreover, this is also true for external validators, for example, ReCaptchaV2 (there is a built-in validator that also does not return a lexicon with an error).

Environment

FormIt 4.2.7-pl
MODX 2.8.4

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

No branches or pull requests

1 participant