Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
rdf.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2010 at 18:08 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedIt seems like it might be helpful to have a language tag on the username in case the username is transliterated into another language.
The foaf project wiki says this:
http://wiki.foaf-project.org/w/NamesInFoaf
Comment #2
Anonymous (not verified) commentedActually, I see... the problem is that it inherits the language tag when it might not be in the same language (if it was not transliterated).
Comment #3
Anonymous (not verified) commentedCode with comment.
I included a conditional that makes sure that xml:lang for the username is not already set. This is because someone could use Transliterate API on the username, at which point they would might want to use MODULE_preprocess_username to set the xml:lang attribute. The conditional in the patch will ensure that RDF module doesn't overwrite the values set in the other module's preprocess_username implementation.
If I do understand the problem correctly—if the problem is that xml:lang is inherited by the username when the username might not be in the same language—then this would apply to regular XHTML as well, correct? In which case, it seems like its actually an issue with template_preprocess_username. I'm not saying we should try to get this fix in theme.inc, but it seems like it would have the same problem.
I can write a test for this today.
Comment #4
Anonymous (not verified) commented+++ modules/rdf/rdf.module 12 Jan 2010 12:42:21 -0000
@@ -475,6 +475,15 @@ function rdf_preprocess_user_profile(&$v
+ if (!isset($variables['attributes_array']['xml:lang'])) {
Whoops! We actually want to set the value if it is not already set.
Changing !isset to empty
I'm on crack. Are you, too?
EDIT: I am seriously having an on crack moment... Patch was fine with !isset, but changed to empty for consistency with the rest of the function.
Comment #5
Anonymous (not verified) commentedAdded a test that makes sure the default user mapping is used on the authored by line on a post (I didn't see a test for this... we do test that in comments and on the tracker page, but I don't think there is one for just a regular post.) In this test, I made sure that xml:lang is explicitly set on the username.
Comment #6
aspilicious commentedneeds review I suppose
Comment #7
scor commented'content' is somewhat ambiguous. 'page content' or 'page' might make more sense.
otherwise looks good.
2 days to code freeze. Better review yourself.
Comment #8
Anonymous (not verified) commentedThanks for reviewing, changed 'content' to 'page'.
Comment #9
dries commented- Can we write HTML instead of html?
- So when it is set to the empty string, it means what? That the language is unknown?
Comment #10
Anonymous (not verified) commented- To be more precise, I changed 'html container' to be 'HTML element'
- Here is what the XML specification says:
"In particular, the empty value of xml:lang is used on an element B to override a specification of xml:lang on an enclosing element A, without specifying another language."
Comment #11
scor commentedthat there is no language attached to the user name. Core does not allow to specify a language for the username. Why would the language of a given page also carry on the username?
Comment #12
scor commented#10 is good to go.
Comment #13
scor commentedreroll after #678594: Fix RDFa markup for file/image formatters got committed.
Comment #14
webchickMinor stuff, but...
'translated', not 'transliterated', right?
I'm confused. Wasn't the point of this patch to /not/ set xml:lang on username? Is the assertion message wrong?
Powered by Dreditor.
Comment #15
scor commentedright, the second hunk assertion message is confusing. It should say "xml:lang is set to empty on username".
Comment #16
Anonymous (not verified) commented1. I believe transliterate is correct here. You translate meaning, you transliterate phonetics. People would use http://drupal.org/project/transliteration to transliterate the names.
2. Changed the comment to be clearer that we are setting a null xml:lang attribute.
Comment #17
scor commentedlooks good.
Comment #18
dries commentedCommitted to CVS HEAD. Thanks.