Hi,

I've just installed your very interesting module to experiment on the NZ GPS Society's website.

I installed KML.module, location.module was of course already installed. I clicked on a KML link on a spatially-enabled node but it didn't open properly in Google Earth. I went node > edit and received the following error which appeared to be caused by kml.module.

    * user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT l.eid FROM location l WHERE l.source != 0 AND l.type = ' query: SELECT n.nid, n.created FROM node n WHERE n.status = 1 AND n.vid IN (SELECT l.eid FROM location l WHERE l.source != 0 AND l.type = 'node' AND l.eid = n.vid) AND n.nid = 141 in /home/gpsorgnz/public_html/includes/database.mysql.inc on line 121.
    * warning: Invalid argument supplied for foreach() in /home/gpsorgnz/public_html/modules/kml/kml.module on line 451.
    * user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT l.eid FROM location l WHERE l.source != 0 AND l.type = ' query: SELECT n.nid, n.created FROM node n WHERE n.status = 1 AND n.vid IN (SELECT l.eid FROM location l WHERE l.source != 0 AND l.type = 'node' AND l.eid = n.vid) AND n.nid = 141 in /home/gpsorgnz/public_html/includes/database.mysql.inc on line 121.
    * warning: Invalid argument supplied for foreach() in /home/gpsorgnz/public_html/modules/kml/kml.module on line 451.

The node works fine with location and gmap - it is mapping it in Google Maps.

Comments

geodaniel’s picture

Please could you confirm which version of MySQL you're using? I suspect the problem is that I've started using a subquery where previously there wasn't one, and subqueries are only possible in MySQL 4.1 and newer. I'll look into doing this a different way...

As for the foreach error, that's already noted in #113006.

rediguana’s picture

The hosting company is providing 4.0.27-standard - so that might be part of the problem.

Cheers Gav

geodaniel’s picture

Title: KML module causes node errors » Make KML module MySQL 4.0 compatible
Version: 4.7.x-1.x-dev » master
Category: bug » task
Priority: Critical » Normal
geodaniel’s picture

Status: Active » Closed (duplicate)