diff --git a/core/modules/node/node.module b/core/modules/node/node.module index b719ee2..a326ba6 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -586,20 +586,14 @@ function template_preprocess_node(&$variables) { // - The node is in preview and view mode is either 'full' or 'default'. $variables['page'] = ($variables['view_mode'] == 'full' && (node_is_page($node)) || (isset($node->in_preview) && in_array($node->preview_view_mode, array('full', 'default')))); - // Helpful $content variable for templates. - $variables += array('content' => array()); - foreach (Element::children($variables['elements']) as $key) { - $variables['content'][$key] = $variables['elements'][$key]; - } - // Display post information only on certain node types. $node_type = $node->type->entity; // Used by RDF to add attributes around the author and date submitted. $variables['display_submitted'] = $node_type->displaySubmitted(); if ($variables['display_submitted']) { $variables['author_attributes'] = new Attribute(); - $variables['date'] = drupal_render($variables['elements']['created']); - $variables['author_name'] = drupal_render($variables['elements']['uid']); + $variables['date'] = \Drupal::service('renderer')->render($variables['elements']['created']); + $variables['author_name'] = \Drupal::service('renderer')->render($variables['elements']['uid']); if (theme_get_setting('features.node_user_picture')) { // To change user picture settings (e.g. image style), edit the 'compact' // view mode on the User entity. Note that the 'compact' view mode might @@ -610,6 +604,12 @@ function template_preprocess_node(&$variables) { unset($variables['elements']['uid']); unset($variables['elements']['created']); + // Helpful $content variable for templates. + $variables += array('content' => array()); + foreach (Element::children($variables['elements']) as $key) { + $variables['content'][$key] = $variables['elements'][$key]; + } + // Add article ARIA role. $variables['attributes']['role'] = 'article'; }