Closed (fixed)
Project:
GMap Module
Version:
5.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2008 at 03:03 UTC
Updated:
10 Jul 2008 at 18:52 UTC
The GMap module generates code that breaks the html validator. Not a major problem but still not clever.
The ID of the div that wraps around the map gets the id attribute twice. It seems the theme_gmap function passes the id in the element[#attributes] array to drupal_attributes() as well using the element[#id] to assign the divs id.
Lines 1103 to 1108 in gmap.module…
$element['#attributes']['class'] = trim($element['#attributes']['class'] .'gmap gmap-map gmap-'. $map['id'] .'-gmap');
// Some markup parsers (IE) don't handle empty inners well. Use the space to let users know javascript is required.
// @@@ Bevan sez: Google static maps could be useful here.
// @@@ Bdragon sez: Yeah, would be nice, but hard to guarantee functionality. Not everyone uses the static markerloader.
$o = '<div id="'. $element['#id'] .'" style="'. implode('; ', $style) .';"'. drupal_attributes($element['#attributes']) .'>'. t('Javascript is required to view this map.') .'</div>';
Not sure if there is a reason for this duplication (Javascript isn't my strong point), but simply removing the id="'. $element['#id'] .' from line 1108 should fix it.
I can't test at the moment because I'm using a macro in a body field so the GMap div ends up inside a paragraph tag, (& also fails validation).
Drew
Comments
Comment #1
bdragon commentedNo, you're right, it's a bug.
I just took a bunch of stuff out of that line and just put in class="gmap-nojs-warning". That should take care of it...
http://drupal.org/cvs?commit=123679
Thanks for the report!
Comment #2
bdragon commentedWhoops, I accidentally changed the master div. Reverting and reopening.
Comment #3
bdragon commentedOK, fixed in the original suggested way ;)
Comment #4
drew reece commentedExcellent, Thanks.
Just out of interest any idea how long it take for this to reach the stable release? Is there any kind of schedule developers follow, or is it simply when enough commits are added a release is made?
D
Comment #5
bdragon commentedIt's been "As soon as possible" for a while now. Every week I hope for "This week!"
I really am working towards a stable release, I promise ;)
Comment #6
drew reece commentedLOL,
I'm not specifically targeting you, just not sure if its worth spending time patching from CVS.
To be honest it's such a minor problem I can wait a while anyway. GMap looks like a big module, pretty handy though, I dunno how you handle it with all the other stuff you commit to :)
D
Comment #7
drew reece commentedOne more thing…
I figured out that wrapping macro text in a <div> causes it to not be placed inside a <p> (which also breaks validation as stated in the OP).
Simple really.
I guess someone may stumble on this and find it helpful.
D
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.