Closed (fixed)
Project:
Microdata
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2013 at 17:17 UTC
Updated:
24 Jul 2013 at 21:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedHere's what the HTML5 spec says:
It seems to me that the HTML you post is valid according to the spec, since there is no name, http-equiv, or itemprop. I suspect that the validator you are using isn't compliant with the spec on this.
Comment #2
Anonymous (not verified) commentedActually, looking at the spec I realize that one of those elements or charset must be specified. So this should be changed to a span tag or something similar.
Comment #3
drew29 commentedHello linclark,
i have test it with w3c validator and the http://html5.validator.nu but I have the same errors.
can you help me to specified the elements or charset?
sorry for my bad english.
kind regards
drew
Comment #4
Anonymous (not verified) commentedUnfortunately, my focus is on D8 at the moment, so I'm not working on patches for microdata. Hopefully someone else can pick this up.
Comment #5
dr.user commentedPatch for 7.x-1.0-beta2
Comment #6
dr.user commentedForget about my previous post and check solution in #1947266: Microdata for node are embedded incorrectly
Comment #7
roderikActually, I don't agree with 'forget about your previous post':
theme_microdata_item_meta_tags()still produces invalid output (meta tags in places that generate errors), so it should be fixed, or deleted.theme_microdata_item_meta_tags()still needs to catch & output data for other entity types.I think it's good to look at these things separately. This patch is, IMHO, ready for committing. Its scope is small. It will fix strange errors that people are getting, and thereby make other issues easier to understand (if they still turn out to be issues, after applying this patch).
Also: the 'move the attributes for nodes to the node DIVs, instead of extra separate tags' solutions in #1947266: Microdata for node are embedded incorrectly are useful to look at, but there are still some pitfalls to be worked out (or at least documented).
Comment #8
roderikAhem. I hadn't seen that that patch was not valid against the current -dev.
Also, this tests on 'itemscope', not 'content' -- to a.o. cover the error reported in #1947266-1: Microdata for node are embedded incorrectly .
Now really 'needs review'.
Comment #9
roderikWow. BIG mistake in rerolling. I blame it on handling too many patches at once ;)
RE-retry.
Oh yeah, and this patch includes the other end of #2037161: Output 'itemscope' instead of 'itemscope=""' for fields....
Comment #10
Anonymous (not verified) commentedI was just posting in #2037161: Output 'itemscope' instead of 'itemscope=""' for fields. as you were posting this.
Can you try the following patch? It just changes the tag that is used when the items are added to the render array, which should do the trick.
Comment #11
roderikAh, right! I see, all items output there are always items/entities, duh.
My test site confirmed. But "Inspect element" reminded me that spans need to be closed :) One example fix is attached.
(And this time I'm leaving the last hunk in, which is creeping into every patch...)
------
Since we're semi-live fixing today, I'll misuse this issue for some coordination...
If you commit this, then:
* With #1947266: Microdata for node are embedded incorrectly rightfully postponed... there is no practical use for #2036819: Restructure microdata_item() storage anymore. (I still like the concept of doing 'data gathering' before the theming phase, but if all output always stays in $page['content'], there's just no reason.)
I'll probably do a braindump in #1947266 just to record my actions & where I ran into a brick wall, but it won't make a practical difference.
* #2038397: Only create itemrefs and extra properties, for 'real items'. still is a valid issue which will clean up the HTML output, IMHO. If you think so too, after reviewing the issue description... please just put to CNW and I'll reroll.
Comment #12
Anonymous (not verified) commentedAh, that's right! I didn't think through the fact that span is not a void tag.
Since there is a defined list of void elements in HTML5, I think I might prefer to check whether the tag is a void element. This patch demonstrates what I'm talking about. Would you mind testing it again?
Comment #13
roderikSure.
It works as expected. (And I familiarized myself with the 'end slash' of a void element, and when it's optional, just to be sure. Still learning :) )
Comment #14
Anonymous (not verified) commentedGreat, thanks for catching the tag problem and for testing.
Fixed with commit http://drupalcode.org/project/microdata.git/commit/6739979