diff -u b/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php --- b/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -56,7 +56,6 @@ * Overrides Drupal\Core\Entity\EntityFormController::form(). */ public function form(array $form, array &$form_state, EntityInterface $node) { - $user_config = config('user.settings'); // Some special stuff when previewing a node. if (isset($form_state['node_preview'])) { diff -u b/core/themes/seven/template.php b/core/themes/seven/template.php --- b/core/themes/seven/template.php +++ b/core/themes/seven/template.php @@ -116,40 +116,36 @@ * Implements hook_form_alter(). + * + * Changes vertical tabs to container and adds meta information. */ -function seven_form_alter(&$form, $form_state, $form_id) { - // Change vertical tabs to container on node forms and add meta information. - if (isset($form_state['build_info']['base_form_id']) && $form_state['build_info']['base_form_id'] == 'node_form') { +function seven_form_node_form_alter(&$form, $form_state) { + $node = $form_state['controller']->getEntity($form_state); - $node = $form_state['controller']->getEntity($form_state); - - $form['meta'] = array ( - '#type' => 'fieldset', - '#attributes' => array('class' => array('entity-meta-header')), - '#type' => 'container', - '#group' => 'advanced', - '#weight' => -100, - // @todo Geez. Any .status is styled as OK icon? Really? - 'published' => array( - '#type' => 'item', - '#wrapper_attributes' => array('class' => array('published')), - '#markup' => !empty($node->status) ? t('Published') : t('Not published'), - '#access' => !empty($node->nid), - ), - 'changed' => array( - '#type' => 'item', - '#wrapper_attributes' => array('class' => array('changed', 'container-inline')), - '#title' => t('Last saved'), - '#markup' => !$node->isNew() ? format_date($node->changed, 'short') : t('Not saved yet'), - ), - 'author' => array( - '#type' => 'item', - '#wrapper_attributes' => array('class' => array('author', 'container-inline')), - '#title' => t('Author'), - '#markup' => user_format_name(user_load($node->uid)), - ), - ); - - $form['advanced']['#type'] = 'container'; - $form['revision_information']['#type'] = 'container'; - $form['revision_information']['#group'] = 'meta'; - } + $form['advanced']['#type'] = 'container'; + $form['meta'] = array ( + '#type' => 'fieldset', + '#attributes' => array('class' => array('entity-meta-header')), + '#type' => 'container', + '#group' => 'advanced', + '#weight' => -100, + 'published' => array( + '#type' => 'item', + '#wrapper_attributes' => array('class' => array('published')), + '#markup' => !empty($node->status) ? t('Published') : t('Not published'), + '#access' => !empty($node->nid), + ), + 'changed' => array( + '#type' => 'item', + '#wrapper_attributes' => array('class' => array('changed', 'container-inline')), + '#title' => t('Last saved'), + '#markup' => !$node->isNew() ? format_date($node->changed, 'short') : t('Not saved yet'), + ), + 'author' => array( + '#type' => 'item', + '#wrapper_attributes' => array('class' => array('author', 'container-inline')), + '#title' => t('Author'), + '#markup' => user_format_name(user_load($node->uid)), + ), + ); + $form['revision_information']['#type'] = 'container'; + $form['revision_information']['#group'] = 'meta'; }