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

Problem found in #1777956-82: Provide a way to define default values for entity fields

CommentFileSizeAuthor
#1 user-appropiate_labels-2019741-1.patch1.18 KBjeroent

Comments

jeroent’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB

Added patch with appropriate labels.

berdir’s picture

Thanks, this looks good. Will need a re-roll after the referenced issue has been committed however, so not yet RTBC'ing it yet.

berdir’s picture

Issue tags: -Novice, -Entity Field API

Status: Needs review » Needs work
Issue tags: +Novice, +Entity Field API

The last submitted patch, user-appropiate_labels-2019741-1.patch, failed testing.

berdir’s picture

Issue tags: +Needs reroll

Could 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.

undertext’s picture

This is already done. See last dev.

linl’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Needs reroll

Yes, this was done in #2002162: Convert form validation of users to entity validation so closing as duplicate.