Postponed (maintainer needs more info)
Project:
Microdata
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2013 at 21:14 UTC
Updated:
11 Oct 2019 at 13:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ZDKia commentedWe run into this issue and we modified microdata.module to include the patch code in 1947266 to corrected it as a workaround.
With a W3C HTML validator error of:
"Document type does not allow element "meta" here"
For which was showing errors referencing:
The microdata.module was modified to include the fix:
"Microdata for node are embedded incorrectly --- drupal.org/node/1947266
Attribute "itemscope" should define container for object, but currently is added as tag."
At this moment,
we need to address a similar error in a different HTML line.
Line 147, Column 106: there is no attribute "itemscope"
We still have the "itemscope" error but in a different line. the generated HTML shows:
<have the <div id="node-19" class="node node-article node-promoted node-sticky node-teaser clearfix" itemscope="">Any suggestions?
Thanks!
Comment #2
jamsilver commentedRolling a patch in accordance with the guidelines.
Also, I'm not sure why the above patch was removing the meta tag declaring the node name, but it's not in my reroll.
Comment #3
jamsilver commentedActually - here's a re-written version which conforms to Drupal's coding standards and doesn't throw a PHP Notice now and then.
Comment #4
Anonymous (not verified) commentedI'm not sure what the problem is here that needs to be solved.
Any standards compliant microdata parser should be able to understand the following pattern:
You can test it at http://foolip.org/microdatajs/live/ or http://www.google.com/webmasters/tools/richsnippets, and you'll see that the properties are extracted as expected.
Comment #5
roderik@ZDKia / #1: #1920400-12: Error: Element meta is missing required attribute content has now been incorporated into the -dev version, which should fix your problem. (A 'july-11' version should be appearing sometime; the 'july-10' version does not have this patch yet.)
@jamsilver / #2: the original patch was
"removing the meta tag declaring the node name"skipping the output of all the 'node' elements, because the 'regular' microdata elements are already output in the node div. dr.user probably forgot that there are 'name' and 'url' meta tags too, which should be output in that place.But if you completely skip that check, you're outputting the 'regular' metadata for the node twice, which is not a good idea.
I first thought this issue was a nice way of solving things. After all, if we are moving from 'meta' to 'span' tags anyway, why not move all the tags into the dedicated div for the node?
... well, these are the problems:
So there is no way you can really do this correctly, in a generic way. Unless you start whipping up big and fine grained (and confusing) configuration methods.
hook_page_process()hook_page_process()because it's the only 'generic' place where we can count on them being output. Node templates themselves do not have a$node['content']variable that is present in standard templates.hook_page_process()runs.I actually made a patch to catch point 3; generate all 'itemrefs' in hook_entity_load(), not hook_page_process(). It's at #2036819: Restructure microdata_item() storage
...but that was before I realized point 2 above :(
I'm uploading the work I did... which depends on #2036819: Restructure microdata_item() storage already being applied. It also does 'in-div output' for taxonomy terms and comments, besides nodes. But in hindsight, I agree with #4. There is no problem to solve here. And this patch will make HTML checkers output 'duplicate item references' errors.
Comment #5.0
roderikAdded missing info about patched file
Comment #6
summit commentedHi,
Is there a way to remove the google errors related to
I can't figure it out...
Thanks for your input in advance, greetings, Martijn