Hi all,

Not sure if anyone else is getting this error but I haven't seen anything logged in the queue. For whatever reason, the error seems to pop up during CRON when checking for module new releases and updates.

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 '' at line 1 query: DELETE FROM location_instance WHERE  in /home/civisch9/public_html/sites/all/modules/location/location.module on line 824.

The line that seems to be referenced is:

   $querybase = 'FROM {location_instance} WHERE '. implode(' AND ', $qfrags);

    $oldlids = array();
    $newlids = array();
    // Find affected lids.
    $query = "SELECT lid $querybase";
    $result = db_query($query, $args);
    while ($t = db_fetch_object($result)) {
      $oldlids[] = $t->lid;
    }

/* LINE 824 */ $query = "DELETE $querybase";
    db_query($query, $args);

Thanks!

Comments

Apollo610’s picture

Just wondering if anyone else is getting this error... or knows the best way to begin troubleshooting it?

pyxio’s picture

Hi,

Yes, I get this error too. How can we fix it? regards, Kevin

Apollo610’s picture

Status: Active » Closed (duplicate)

FYI - this issue was resolved for me in the latest iteration of 3.x-dev (Jul-31-09)

Details here.

Apollo610’s picture

Priority: Minor » Normal
Status: Closed (duplicate) » Active

Actually, this error is back for me...

Steps I've taken to resolve error:
1) Uninstalled Location and reinstalled 6.x-3.x-dev from 7/31
2) Configured location settings on RSS FEEDS and RSS FEED NODES so that location is turned off (no locative settings), and that the RSS option for each content type is "none"
3) Delete all previously existing RSS Feed Nodes.
4) Refresh RSS Feeds, which repopulates the RSS Feed Nodes.
5) Error displays after this refresh, there is a pair of errors (referencing lines 812 and 818) for every new RSS Feed Node item that is created by the refresh.

So net-net, this error appears to occur when CRON runs and my RSS feed (using FEEDAPI) attempts to find and then delete entries when doing to feed refresh (I have it set to delete feed items older than 4 weeks) that don't exist yet. This error occurs every single time a refresh is done and new RSS items are pulled in.

The only thing that fixes it is to change the RSS Node setting's so that "Delete Items Older Than" is set to "NEVER DELETE" ... at this point i'm not sure if this bug lies with Location or FeedAPI?

Function: function location_save_locations
Error:

# 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 '' at line 1 query: SELECT lid FROM location_instance WHERE in /sites/all/modules/location/location.module on line 812.
# 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 '' at line 1 query: DELETE FROM location_instance WHERE in /sites/all/modules/location/location.module on line 818.
yesct’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +location bdragon check

Please check to see if this is still a problem in the new release. If it is, reply with a new summary and set the status back to active.

ankur’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing due to lack of follow up. It looks like this may have been fixed elsewhere.

rv0’s picture

Status: Closed (cannot reproduce) » Needs review

change line 886

from

  if (isset($locations) && is_array($locations) && !empty($criteria) && is_array($criteria)) {

to

  if (!empty($locations) && is_array($locations) && !empty($criteria) && is_array($criteria)) {

(it seems $locations will always be set, but can be an empty array sometimes)

podarok’s picture

Status: Needs review » Patch (to be ported)

right status

rv0’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (cannot reproduce)

ignore #7.

Empty locations array is allowed to remove locations, issue indeed is something else.

closing for now as i was the one reopening it.