Closed (fixed)
Project:
GMap Module
Version:
5.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2008 at 14:06 UTC
Updated:
29 Sep 2008 at 14:33 UTC
An error in gmap_location.module causes the function gmap_location_node_page not to produce the marker when the nid is supplied. The original code looks like this:
$marker_sql1 = '';
$marker_sql2 = '';
if (module_exists('gmap_taxonomy')) {
$marker_sql1 = ', m.marker';
$marker_sql2 = 'LEFT JOIN {gmap_taxonomy_node} m ON n.vid = m.vid';
}
$add_sql = (is_numeric($nid) && $nid > 0) ? ' AND n.nid = %d' : '';
// Location 3.x on Drupal 5.
if (function_exists('location_newapi')) {
$result = db_query(db_rewrite_sql("
SELECT n.nid, n.type, n.title, l.latitude, l.longitude $marker_sql1
FROM {node} n
INNER JOIN {location_instance} i
ON n.vid = i.vid
INNER JOIN {location} l
ON l.lid = i.lid
$marker_sql2
WHERE
n.status = 1
AND
(l.latitude != 0 OR l.longitude != 0)
". $add_sql), 'node', $nid);
}
else {
$result = db_query(db_rewrite_sql("
SELECT n.nid, n.type, n.title, l.latitude, l.longitude $marker_sql1
FROM {node} n
INNER JOIN {location} l
ON n.vid = l.eid
$marker_sql2
WHERE
l.type = '%s'
AND
n.status = 1
AND
(l.latitude != 0 OR l.longitude != 0)
". $add_sql), 'node', $nid);
}
The problem is in the first case of the condition and particularly in the line
". $add_sql), 'node', $nid);
The 'node' parameter is not valid in this query (no type criteria is included in the query) and the result is that the value 'node' is passed as the nid when the relevant criteria is added. If this is already corrected just ignore me. I just came across this issue and thought that it would be a good idea to let you know.
Comments
Comment #1
bdragon commentedYou're absolutely right.
Fixed in DRUPAL-5--3 and HEAD.
http://drupal.org/cvs?commit=140144
http://drupal.org/cvs?commit=140145
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.