Feature: #97104 - New TCA type “password”¶
See Issue #97104
Especially TCA type
input has a wide range of use cases, depending
on the configured
renderType and the
eval options. Determination
of the semantic meaning is therefore usually quite hard and often leads to
duplicated checks and evaluations in custom extension code.
In our effort of introducing dedicated TCA types for all those use cases, the
password has been added. It replaces the
eval=saltedPassword option of TCA type
TCA password fields will be rendered as input
By default, the
autocomplete=off attribute will be added to the
resulting input field. If
autocomplete=true is configured in TCA, a
autocomplete=new-fieldname attribute will be added to the element.
The TCA type
password features the following column configuration:
The following column configuration can be overwritten by Page TSconfig:
By default, TCA type
password will always save the field value as a
hashed to the database. The value will be hashed using the password hash
configuration for BE for all tables except fe_user, where the password hash
configuration for FE is used.
The TCA type
password introduces the new configuration
which can be set to
false, if the field value should be saved as
plaintext to the database.
'hashed' => false has no effect for all fields in
fe_users. In general it is not
recommended to save passwords as plain text to the database.
The migration from
type=password is done like following:
// Before 'password_field' => [ 'label' => 'Password', 'config' => [ 'type' => 'input', 'eval' => 'trim,password,saltedPassword', ] ] // After 'password_field' => [ 'label' => 'Password', 'config' => [ 'type' => 'password', ] ] // Before 'another_password_field' => [ 'label' => 'Password', 'config' => [ 'type' => 'input', 'eval' => 'trim,password', ] ] // After 'another_password_field' => [ 'label' => 'Password', 'config' => [ 'type' => 'password', 'hashed' => false, ] ]
An automatic TCA migration is performed on the fly, migrating all occurrences
to the new TCA type and triggering a PHP
where code adoption has to take place.
The value of TCA type
password column is automatically trimmed before
being stored (and optionally hashed) in the database. Therefore, the
option is no longer needed and should be removed from the TCA configuration.
It’s now possible to simplify the TCA configuration by using the new
dedicated TCA type