diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 74587a1..0f128d7 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -134,6 +134,12 @@ public function form(array $form, FormStateInterface $form_state) { '#markup' => !$node->isNew() ? format_date($node->getChangedTime(), 'short') : $this->t('Not saved yet'), '#wrapper_attributes' => ['class' => ['entity-meta__last-saved']], ]; + $form['meta']['author'] = [ + '#type' => 'item', + '#title' => $this->t('Author'), + '#markup' => $node->getOwner()->getUsername(), + '#wrapper_attributes' => ['class' => ['entity-meta__author']], + ]; $form['footer'] = [ '#type' => 'container', diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index cebf088..456df93 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -147,12 +147,9 @@ function seven_preprocess_maintenance_page(&$variables) { /** * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm. * - * Changes vertical tabs to container and adds meta information. + * Changes vertical tabs to container. */ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) { - /** @var \Drupal\node\NodeInterface $node */ - $node = $form_state->getFormObject()->getEntity(); - $form['#theme'] = ['node_edit_form']; $form['#attached']['library'][] = 'seven/node-form'; @@ -160,12 +157,7 @@ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) { $form['meta']['#type'] = 'container'; $form['meta']['#access'] = TRUE; $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline'; - $form['meta']['author'] = [ - '#type' => 'item', - '#wrapper_attributes' => ['class' => ['author', 'container-inline']], - '#title' => t('Author'), - '#markup' => $node->getOwner()->getUsername(), - ]; + $form['meta']['author']['#wrapper_attributes']['class'][] = 'container-inline'; $form['revision_information']['#type'] = 'container'; $form['revision_information']['#group'] = 'meta';