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 @@ -418,6 +418,15 @@ if (!empty($variables['homepage']) && !empty($homepage_mapping)) { $attributes['rel'] = $homepage_mapping['properties']; } + // Long usernames are truncated by template_preprocess_username(). + // In these cases, store the full username in the 'content' attribute. + if ($variables['truncated']) { + $attributes['content'] = check_plain($variables['name_raw']); + // If we don't unset the 'datatype' attribute, EasyRdf_Parser_Rdfa will + // ignore the 'content' attribute and still use the element's text content + // (that is, the shortened username). + unset($attributes['datatype']); + } // The remaining attributes can have multiple values listed, with whitespace // separating the values in the RDFa attributes // (see http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes). @@ -434,16 +443,6 @@ if (!empty($variables['homepage']) && !empty($homepage_mapping)) { $attributes['rel'] = $homepage_mapping['properties']; } - // Usernames over 20 characters in length are truncated - // by template_preprocess_username(). - // In these cases, store the full username in the 'content' attribute. - if (drupal_strlen($variables['name_raw']) > 20) { - $attributes['content'] = check_plain($variables['name_raw']); - // If we don't unset the 'datatype' attribute, EasyRdf_Parser_Rdfa will - // ignore the 'content' attribute and still use the element's text content - // (that is, the shortened username). - unset($attributes['datatype']); - } // The remaining attributes can have multiple values listed, with whitespace // separating the values in the RDFa attributes // (see http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes). only in patch2: unchanged: --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -635,6 +635,10 @@ function template_preprocess_username(&$variables) { $name = $variables['name_raw'] = $account->getUsername(); if (drupal_strlen($name) > 20) { $name = drupal_substr($name, 0, 15) . '...'; + $variables['truncated'] = TRUE; + } + else { + $variables['truncated'] = FALSE; } $variables['name'] = check_plain($name); $variables['profile_access'] = user_access('access user profiles');