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

PowermailValidator misses LANG for error translation #8

Open
mueller-sebastian opened this issue Dec 22, 2023 · 0 comments
Open

PowermailValidator misses LANG for error translation #8

mueller-sebastian opened this issue Dec 22, 2023 · 0 comments

Comments

@mueller-sebastian
Copy link

An error friendlycaptcha throws an Exception: Return value of StudioMitte\FriendlyCaptcha\FieldValidator\PowermailValidator::getLanguageService() must be an instance of TYPO3\CMS\Core\Localization\LanguageService, null returned

PowermailValidator.php uses $GLOBALS['LANG'] for error translation.
It is not available in FE and it is discouraged to use this variable directly (in FE).

https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/Configuration/GlobalVariables.html#confval-LANG

Using translateErrorMessage of TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator like it is used in studiomitte/friendlycaptcha/Classes/FieldValidator/FormValidator.php does work.

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