diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index 5ba2e37a687c28dc9f7c4ee6ed5e19fea9169935..0d20345ad9bdcc03385b3ae794dc05982adaf955 100644 --- a/modules/rdf/rdf.test +++ b/modules/rdf/rdf.test @@ -187,6 +187,25 @@ class RdfRdfaMarkupTestCase extends DrupalWebTestCase { )); $this->assertTrue(!empty($image_rel), t('Attribute \'rel\' set on image field. Attribute \'resource\' is also set.')); + + // Edits the node to add tags. + $tag1 = $this->randomName(8); + $tag2 = $this->randomName(8); + $edit = array(); + $edit['field_tags[' . LANGUAGE_NONE . ']'] = "$tag1, $tag2"; + $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); + // Ensures the RDFa markup for the relationship between the node and its + // tags is correct. + $term_rdfa_meta = $this->xpath('//div[@about=:node-url and contains(@typeof, "sioc:Item") and contains(@typeof, "foaf:Document")]//ul[@class="links"]/li[@rel="dc:subject"]/a[@typeof="skos:Concept" and text()=:term-name]', array( + ':node-url' => url('node/' . $node->nid), + ':term-name' => $tag1, + )); + $this->assertTrue(!empty($term_rdfa_meta), t('Property dc:subject is present for the tag1 field item.')); + $term_rdfa_meta = $this->xpath('//div[@about=:node-url and contains(@typeof, "sioc:Item") and contains(@typeof, "foaf:Document")]//ul[@class="links"]/li[@rel="dc:subject"]/a[@typeof="skos:Concept" and text()=:term-name]', array( + ':node-url' => url('node/' . $node->nid), + ':term-name' => $tag2, + )); + $this->assertTrue(!empty($term_rdfa_meta), t('Property dc:subject is present for the tag2 field item.')); } } diff --git a/themes/bartik/template.php b/themes/bartik/template.php index f3bc93b27b5a5cdc53647a82581143f9b57c34fc..2867f6b5a8c8f12b76e68843ce288f77437cd2ee 100644 --- a/themes/bartik/template.php +++ b/themes/bartik/template.php @@ -143,7 +143,7 @@ function bartik_field__taxonomy_term_reference($variables) { // Render the items. $output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul class="links">'; foreach ($variables['items'] as $delta => $item) { - $output .= '<li class="taxonomy-term-reference-' . $delta . '">' . drupal_render($item) . '</li>'; + $output .= '<li class="taxonomy-term-reference-' . $delta . '"' . $variables['item_attributes'][$delta] . '>' . drupal_render($item) . '</li>'; } $output .= '</ul>';