Validation rules
Every value a website user submits is checked before it reaches a record. The rules are per record type and per field, and the same rules apply whether a whole record or a single field was submitted.
How a save is validated
| Save | Checked |
|---|---|
| A whole record | Every field listed below for that record type. A field the payload does not carry takes its default, which is the empty value, so a required field that is left out is reported as empty. |
| A single field | Only that field. The rules of the other fields are not evaluated at all, so an inline save of one field never reports a different one as missing. |
The list of fields below is at the same time the list of names a save may
address. A name that is not in it is refused with 400 rather than
ignored, so uid, pid, hidden, the image and the owning
website user have no path into a record through a save.
Profile
| Field | Rule | Message id |
|---|---|---|
shortname | Required. | validation. |
shortname | Between 2 and 255 characters. | validation. |
firstname | Optional, at most 255 characters. | validation. |
lastname | Optional, at most 255 characters. | validation. |
birthday | Optional. When given, a date in the format YYYY-. | validation. |
bio | Optional, at most 5000 characters. | validation. |
The 255 character bounds are the length of the varchar columns the
values are stored in. The 5000 character bound of the biography is not a column
limit — the column is a text column — it bounds the request payload.
A birthday is a date and nothing else: a value carrying a time of day is
rejected rather than truncated, and a date that does not exist, such as
2026-, is rejected rather than rolled forward. An empty value
means "no birthday" and passes.
Postal address
| Field | Rule | Message id |
|---|---|---|
type | One of home, work, others. An empty value
is refused as well. | validation. |
line1 | Required. | validation. |
line1 | At most 255 characters. | validation. |
line2 | Optional, at most 255 characters. | validation. |
E-mail address
| Field | Rule | Message id |
|---|---|---|
type | One of private, business, others. An empty
value is refused as well. | validation. |
email | Required. | validation. |
email | A valid e-mail address. | validation. |
email | At most 255 characters. | validation. |
Two further ids exist and are shown only by a rule that names no message of its own. No rule shipped with this extension does, so they appear once a rule set is changed:
| Message id | Belongs to |
|---|---|
validation. | The value-set check used by the two type fields. |
validation. | The date check used by birthday. |
The messages of a rejected image upload are listed in Image upload.
Overriding the messages
All ids above are trans- ids in
EXT:.
A translation is added the usual way, as a language file next to the English
one. Changing the English wording, or the wording of an already translated
language, is done with a resource override in
config/ or additional..
The configuration path for this differs between the supported TYPO3 versions. On TYPO3 v13:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:modern_extbase_frontend_edit/Resources/Private/Language/locallang.xlf'][]
= 'EXT:my_sitepackage/Resources/Private/Language/Overrides/modern_extbase_frontend_edit.xlf';
On TYPO3 v14 that path was renamed, and the old one is no longer read:
$GLOBALS['TYPO3_CONF_VARS']['LANG']['resourceOverrides']['EXT:modern_extbase_frontend_edit/Resources/Private/Language/locallang.xlf'][]
= 'EXT:my_sitepackage/Resources/Private/Language/Overrides/modern_extbase_frontend_edit.xlf';
Both accept a list, so several override files can be stacked, and both accept a locale as an additional first key to override one language only.
Note
The TypoScript _LOCAL_ mechanism does not reach these
labels. Validation messages are resolved by the validators themselves,
through the fully qualified label reference rather than through a plugin's
language context, and only a resource override applies there.
Messages carrying a number take it from the rule rather than from the text,
through positional placeholders. %1$s and %2$s in the
shortname length message are the lower and the upper bound; every other
length message carries a single %1$s, which is the upper bound. Keep
the placeholders and their order when rewriting a message.