commit 0a2d36f21989e86ab031636de258d93b13dc2cd3 Author: Joel Pittet Date: Sun Apr 27 20:03:58 2014 -0700 fix rdf diff --git a/core/modules/node/node.module b/core/modules/node/node.module index c094b91..1a73492 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -663,11 +663,11 @@ function template_preprocess_node(&$variables) { // Display post information only on certain node types. // Avoid loading the entire node type config entity here that may not exist. $node_type_config = \Drupal::config('node.type.' . $node->bundle()); + // Used by RDF to add attributes around the author and date submitted. + $variables['author_attributes'] = new Attribute(); // Display submitted by default. $variables['display_submitted'] = $node_type_config->isNew() || $node_type_config->get('settings.node.submitted'); if ($variables['display_submitted']) { - // Used by RDF to add attributes around the author and date submitted. - $variables['author_attributes'] = new Attribute(); 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 diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index c17dbb7..e187e9e 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -296,13 +296,13 @@ function rdf_preprocess_node(&$variables) { // Adds RDFa markup for the relation between the node and its author. $author_mapping = $mapping->getPreparedFieldMapping('uid'); - if (!empty($author_mapping['properties']) && $variables['author_attributes']) { + if (!empty($author_mapping['properties']) && $variables['display_submitted']) { $variables['author_attributes']['rel'] = $author_mapping['properties']; } // Adds RDFa markup for the date. $created_mapping = $mapping->getPreparedFieldMapping('created'); - if (!empty($created_mapping) && $variables['author_attributes']) { + if (!empty($created_mapping) && $variables['display_submitted']) { $date_attributes = rdf_rdfa_attributes($created_mapping, $variables['node']->getCreatedTime()); $rdf_metadata = array( '#theme' => 'rdf_metadata', diff --git a/core/themes/bartik/templates/node.html.twig b/core/themes/bartik/templates/node.html.twig index d6373cb..a2932cc 100644 --- a/core/themes/bartik/templates/node.html.twig +++ b/core/themes/bartik/templates/node.html.twig @@ -85,8 +85,8 @@ {{ author_picture }} {% trans %}Submitted by {{ author_name|passthrough }} on {{ date }}{% endtrans %} - {{ metadata }} + {{ metadata }} {% endif %}