Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
language system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Jan 2013 at 17:08 UTC
Updated:
22 Jan 2021 at 18:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
heine commentedA possible alternative to investigate would be a switch to XHTML+RDFa 1.1.
Comment #2
heine commentedComment #3
scor commentedGood catch. switching to XHTML+RDFa 1.1 would not really help since this is basically an XML parsing issue. #2 is the way to go. I could not find any other occurrence of
lang(without the leading xml:) in core. Would be good to have @alimirjamali test the patch on http://blog.mirjamali.com/Comment #4
GoddamnNoise commentedHi. I've tested the patch and i've applied it in all my multilingual sites. It works!.
It would be nice if this patch could be committed to Drupal core to make Drupal 7 multilingual sites validate in the W3C validator.
Comment #5
GoddamnNoise commentedAny progress on this issue?. The patch is really simple, works nice and fixes a Drupal core's problem which prevents Drupal multilingual sites to validate in the W3C Validator. Please, could any Drupal core's commiter review this issue and commit this useful patch to Drupal core?.
Comment #6
heine commentedIf you've reviewed and tested the patch sufficiently, please set the status of this issue to "Reviewed & tested by the community" to get it into the committer queue.
Comment #7
GoddamnNoise commentedComment #8
GoddamnNoise commentedOk, done!
Comment #11
dcam commentedComment #12
David_Rothstein commentedThis looks right to me; I guess what happened here is that when the original change was backported from Drupal 8 the difference in HTML vs XHTML wasn't taken into account.
Committed to 7.x - thanks!
Comment #15
dalinWondering if we need to revert this commit. It seems to me that this commit just swapped XHTML errors for HTML errors. When using an HTML5 doctype the W3C HTML validator throws an error:
Doesn't Drupal 7 support both doctypes? Shouldn't we be supplying both attributes?
Comment #16
dalinAh yes, we should be supplying both:
http://www.w3.org/TR/xhtml1/#C_7
Comment #17
geekygnr commented#15 solved my validation issue using 7.43
Comment #18
das-peter commentedFrom what I could figure out providing both indeed seems the best way.
Comment #19
stefan.r commentedLooks good to me, marking for Drupal 7 commit.
Comment #20
David_Rothstein commentedI tried this on http://validator.w3.org/ (with the language switcher block enabled on my local site) and it reintroduces the original bug that was fixed here - the validation error is
there is no attribute "lang".I'm not sure what to do about it - core uses XHTML+RDFa 1.0 by default so if we have to pick one to work with, it should be that (i.e. the original patch that was committed here is correct as is).
It's a real pain to ask HTML5 themes that want to validate to deal with this on their own, but I do think it's possible via https://api.drupal.org/api/drupal/modules%21system%21language.api.php/fu.... Only way I can think of to improve that would be if there is some way we can detect (or let a theme declare) what kind of doctype they are going to use, but the fix might turn out to be more complicated than the workaround.
Comment #21
GoddamnNoise commentedI've faced the same problem reported in #15 too. The patch in #15 solves fixes the HTML Validation. I couldn't check if the original bug was reintroduced because of the html tag used in the theme.
Comment #22
edurenye commentedI'm not sure if was a error on validator.w3.org what was reported in #20, but seems fixed now. The patch in #15 fixes the errors and does not add any extra error.
Comment #23
David_Rothstein commented@edurenye What theme are you using for your tests? My guess is an HTML5 theme, in which case the problem would not occur there.
#20 was done using Bartik. I just tried it again now and got the same validation error I got before.
Comment #24
edurenye commentedYes, you are right, I tested it with the Zen theme. But there it fixes the error, previous to the patch I had the error, so it also occurs there.
We need a solution that works for both cases.
If it does not fix the error, then is a needs work, not a needs review.
Comment #25
joseph.olstadpatch 15 fixed the w3c validation error for us using a custom html5 theme.
I used the w3.org validator, before patch, language-link fails validation, after patch, clean.
I did not test Bartik though. Will take David_Rothsteins word for it.
I'd say html5 is the norm now, so maybe change the default theme in D7 core from bartik to bootstrap. (add bootstrap 7.x-3.x to core)
this could be done in the 7.60 or 7.70 new feature releases.
Comment #26
othermachines commentedI came across the validation error on a search results page. For consistency it might make sense to also include both attributes in the core preprocess function as below (see comment).