2c2 < index 470a76a2dc..53c0f48857 100644 --- > index a5cdb4b3f5..67c03a2496 100644 5c5 < @@ -12,13 +12,21 @@ --- > @@ -15,21 +15,28 @@ 10c10 < if ($entity->getUsername() == "no_edit" && $operation == "update") { --- > if ($entity->getAccountName() == "no_edit" && $operation == "update") { 15c15 < if ($entity->getUsername() == "no_delete" && $operation == "delete") { --- > if ($entity->getAccountName() == "no_delete" && $operation == "delete") { 19a20,25 > > // Account with role sub-admin can manage users with no roles. > if (count($entity->getRoles()) == 1) { > return AccessResult::allowedIfHasPermission($account, 'sub-admin'); > } > - 29a36,37 > > /** 210c218 < index 90b813f6a6..d318e5865a 100644 --- > index a1395f4656..fcfb2e0504 100644 214a223 > use Drupal\Core\Access\AccessibleInterface; 216d224 < use Drupal\Core\Cache\Cache; 220a229 > use Drupal\Core\Form\FormStateInterface; 222,223c231 < use Drupal\Core\Routing\RouteMatchInterface; < @@ -466,21 +468,35 @@ function template_preprocess_username(&$variables) { --- > @@ -380,21 +382,35 @@ function template_preprocess_username(&$variables) { 232,234c240,242 < - $name = $account->getDisplayName(); < - $variables['name_raw'] = $account->getUsername(); < - if (Unicode::strlen($name) > 20) { --- > - $name = $account->getDisplayName(); > - $variables['name_raw'] = $account->getAccountName(); > - if (mb_strlen($name) > 20) { 258c266 < + $variables['truncated'] = Unicode::strlen($variables['name_raw']) > 20; --- > + $variables['truncated'] = mb_strlen($variables['name_raw']) > 20; 267,269c275,277 < $variables['profile_access'] = \Drupal::currentUser()->hasPermission('access user profiles'); < < $external = FALSE; --- > if ($account instanceof AccessibleInterface) { > $variables['profile_access'] = $account->access('view'); > }