diff -u b/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module --- b/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -271,17 +271,33 @@ } /** - * Implements hook_preprocess_HOOK() for field templates. + * Implements hook_preprocess_HOOK() for UID field templates. */ -function rdf_preprocess_field(&$variables) { +function rdf_preprocess_field__node__uid(&$variables) { + _rdf_set_field_rel_attribute($variables); + +} + +/** + * Implements hook_preprocess_HOOK() for Entity Reference field templates. + */ +function rdf_preprocess_field__node__entity_reference(&$variables) { + _rdf_set_field_rel_attribute($variables); +} + +/** + * Sets rel attribute for variables array if property attribute is set. + */ +function _rdf_set_field_rel_attribute(&$variables) { // Swap the regular field property attribute and use rel instead so that it // plays well with the RDFa markup generated for the username. - if (!empty($variables['attributes']['property']) && $variables['field_type'] == 'entity_reference' && $variables['field_name'] == 'uid') { + if (!empty($variables['attributes']['property'])) { $variables['attributes']['rel'] = $variables['attributes']['property']; unset($variables['attributes']['property']); } } + /** * Implements hook_preprocess_HOOK() for node templates. */