diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc index 895f84c..3867a13 100644 --- a/core/modules/user/user.pages.inc +++ b/core/modules/user/user.pages.inc @@ -6,6 +6,7 @@ */ use Drupal\Core\Render\Element; +use Drupal\Component\Utility\String; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; @@ -25,6 +26,13 @@ function template_preprocess_user(&$variables) { $account = $variables['elements']['#user']; + // Core user fields + $variables['content']['email_raw'] = $email = $account->getEmail(); + $variables['content']['email'] = String::checkPlain($email); + $variables['content']['name_raw'] = $name = $account->getUsername(); + $variables['content']['name'] = String::checkPlain($name); + $variables['content']['uid'] = $account->id(); + // Helpful $content variable for templates. foreach (Element::children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key];