Updating author name in preprocessnode The kpr line in the function works – It outputs the author of the node's full name. But setting the author_name variable does not. Why isn't that replacing the author_name variable in my template? (It's just blank.)

If i remove this, it will display the username.

function theme_preprocess_node(&amp;$variables) {
  // die(kpr($variables['node']-&gt;getOwner()-&gt;get('field_full_name')-&gt;getValue()));
  $variables['author_name'] = $variables['node']-&gt;getOwner()-&gt;get('field_full_name')-&gt;getValue();
}
getValue() is probably returning an array, which cannot be interpreted by twig. try:

$variables['author_name'] = $variables['node']-&gt;getOwner()-&gt;get('field_full_name')-&gt;getValue()['value'];


Or search for the right key in there ..