Problem/Motivation
Currently UserStorageController::baseFieldDefinitions() (/core/modules/user/lib/Drupal/user/UserStorageController.php) uses the label "Name" for different base field definitions. That's not really a good idea :D
Snipped:
...
$properties['name'] = array(
'label' => t('Name'),
'description' => t('The name of this user'),
'type' => 'string_field',
'settings' => array('default_value' => ''),
);
$properties['pass'] = array(
'label' => t('Name'),
'description' => t('The password of this user (hashed)'),
'type' => 'string_field',
);
$properties['mail'] = array(
'label' => t('Name'),
'description' => t('The e-mail of this user'),
'type' => 'string_field',
'settings' => array('default_value' => ''),
);
...
Proposed resolution
Set speaking labels for all field definitions.
Remaining tasks
Create a patch. Thanks!
User interface changes
none
API changes
none
Related Issues
Problem found in #1777956-82: Provide a way to define default values for entity fields
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | user-appropiate_labels-2019741-1.patch | 1.18 KB | jeroent |
Comments
Comment #1
jeroentAdded patch with appropriate labels.
Comment #2
berdirThanks, this looks good. Will need a re-roll after the referenced issue has been committed however, so not yet RTBC'ing it yet.
Comment #3
berdir#1: user-appropiate_labels-2019741-1.patch queued for re-testing.
Comment #5
berdirCould use a re-roll. Note that the field definitions moved to the User class, so just re-do the changes should be the easiest way to do it.
Comment #6
undertext commentedThis is already done. See last dev.
Comment #7
linl commentedYes, this was done in #2002162: Convert form validation of users to entity validation so closing as duplicate.