I cannot find anything useful in the D8 changelog nor any comment on the D7 function how I'm able to upgrade the function to D8. Can you help, please?

function realname_user_view(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) {

  if (user_view_access($account)) {
    $markup = l($account->realname, 'user/' . $account->id());
  }
  else {
    $markup = Html::escape($account->realname);
  }

...

Comments

hass created an issue. See original summary.

hass’s picture

Component: user system » user.module
hass’s picture

Status: Active » Fixed
if ($account->access('view')) {

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.