Task #92465
closedTCA eval 'alpha' discards umlaut characters
0%
Description
I'm unable to insert special characters like 'ä' into an input field that is configured with
'eval' => 'alpha'
in TCA, however, 'alpha' is the only available option against non-word characters.
It should at least be mentioned in the documentation, or, if possible, adjusted to allow characters beyond A-Z that are no spaces, numbers or other non-word characters.
System overview:
TYPO3 Version 10.4.9
Webserver Apache/2.4.38 (Debian)
PHP Version 7.4.9
Database (Default) MySQL 5.7.29
Application Context Development
Operating System Linux 4.15.0-118-generic
Updated by Guido Schmechel about 4 years ago
HI Remo, i found this documentation: https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/inputDefault.html?highlight=eval#id15 I think "alpha" is correctly documented.
My opinion: If we include the umlauts in this list, other eval functions are also affected, then we would have to consider other languages/characters. Example: Chinese, Greece or something else.
There is a hook and you can define your own "alpha" eval function:
$value = preg_replace('/[^a-zäöüA-ZÄÖÜß]/', '', $value);
Maybe this will help you?
Updated by Remo Schneider about 4 years ago
Yes, thank you! I will use the hook then.
Updated by Andreas Kienast almost 4 years ago
- Status changed from New to Closed
Closed as this issue can be solved via custom implementation.
Updated by Martin Kutschker almost 4 years ago
Well, the term alphabet only applies to Latin letters: \p{Latin} (maybe used together with \p{L})