diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 3ebe97d..85ed5d1 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -725,15 +725,15 @@ function locale_system_file_system_settings_submit(&$form, $form_state) { * Implements hook_preprocess_HOOK() for node.tpl.php. */ function locale_preprocess_node(&$variables) { - if ($variables['langcode'] != LANGUAGE_NOT_SPECIFIED) { + if ($variables['node']->langcode != LANGUAGE_NOT_SPECIFIED) { $language_interface = language(LANGUAGE_TYPE_INTERFACE); - $node_language = language_load($variables['langcode']); + $node_language = language_load($variables['node']->langcode); if ($node_language->langcode != $language_interface->langcode) { // If the node language was different from the page language, we should // add markup to identify the language. Otherwise the page language is // inherited. - $variables['attributes']['lang'] = $variables['langcode']; + $variables['attributes']['lang'] = $variables['node']->langcode; if ($node_language->direction != $language_interface->direction) { // If text direction is different form the page's text direction, add // direction information as well. diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a997a04..6b7c0d9 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1169,8 +1169,12 @@ function template_preprocess_node(&$variables) { $variables['label'] = check_plain($node->label()); $variables['page'] = $variables['view_mode'] == 'full' && node_is_page($node); - // Flatten the node entity's member fields. - $variables = array_merge((array) $node, $variables); + // Make useful flags and node data available. + // @todo: Check if all are required. + $properties = array('type', 'comment_count', 'uid', 'created', 'promote', 'sticky', 'status', 'comment', 'readmore'); + foreach ($properties as $property) { + $variables[$property] = $node->$property; + } // Helpful $content variable for templates. $variables += array('content' => array()); @@ -1198,13 +1202,13 @@ function template_preprocess_node(&$variables) { // Gather node classes. $variables['attributes']['class'][] = drupal_html_class('node-' . $node->type); - if ($variables['promote']) { + if ($node->promote) { $variables['attributes']['class'][] = 'promoted'; } - if ($variables['sticky']) { + if ($node->sticky) { $variables['attributes']['class'][] = 'sticky'; } - if (!$variables['status']) { + if (!$node->status) { $variables['attributes']['class'][] = 'unpublished'; } if ($variables['view_mode']) { diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 782c06f..2e04773 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -527,7 +527,7 @@ function rdf_preprocess_node(&$variables) { $element = array( '#tag' => 'meta', '#attributes' => array( - 'content' => $variables['title'], + 'content' => $variables['label'], 'about' => $variables['node_url'], ), ); @@ -538,18 +538,18 @@ function rdf_preprocess_node(&$variables) { } // Adds RDFa markup for the date. - if (!empty($variables['rdf_mapping']['created'])) { - $date_attributes = rdf_rdfa_attributes($variables['rdf_mapping']['created'], $variables['created']); + if (!empty($variables['node']->rdf_mapping['created'])) { + $date_attributes = rdf_rdfa_attributes($variables['node']->rdf_mapping['created'], $variables['node']->created); $variables['rdf_template_variable_attributes']['date'] = $date_attributes; if ($variables['submitted']) { $variables['rdf_template_variable_attributes']['submitted'] = $date_attributes; } } // Adds RDFa markup for the relation between the node and its author. - if (!empty($variables['rdf_mapping']['uid'])) { - $variables['rdf_template_variable_attributes']['name']['rel'] = $variables['rdf_mapping']['uid']['predicates']; + if (!empty($variables['node']->rdf_mapping['uid'])) { + $variables['rdf_template_variable_attributes']['name']['rel'] = $variables['node']->rdf_mapping['uid']['predicates']; if ($variables['submitted']) { - $variables['rdf_template_variable_attributes']['submitted']['rel'] = $variables['rdf_mapping']['uid']['predicates']; + $variables['rdf_template_variable_attributes']['submitted']['rel'] = $variables['node']->rdf_mapping['uid']['predicates']; } }