Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2009 at 19:33 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent
if you try to use the proximity filter in a view with a Postgres back end, you'll get the following errors when you try to update the filters
* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of WHERE must be type boolean, not type integer in /home/chris/vijay/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT COUNT(*) FROM (SELECT node.nid AS nid FROM node node LEFT JOIN content_type_profile node_data_field_avatar ON node.vid = node_data_field_avatar.vid WHERE 0 ) count_alias in /home/chris/vijay/sites/all/modules/views/includes/view.inc on line 699.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: argument of WHERE must be type boolean, not type integer in /home/chris/vijay/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT node.nid AS nid, node_data_field_avatar.field_avatar_fid AS node_data_field_avatar_field_avatar_fid, node_data_field_avatar.field_avatar_list AS node_data_field_avatar_field_avatar_list, node_data_field_avatar.field_avatar_data AS node_data_field_avatar_field_avatar_data, node_data_field_avatar.nid AS node_data_field_avatar_nid, node.type AS node_type FROM node node LEFT JOIN content_type_profile node_data_field_avatar ON node.vid = node_data_field_avatar.vid WHERE 0 LIMIT 10 OFFSET 0 in /home/chris/vijay/sites/all/modules/views/includes/view.inc on line 725.
the problem where is the "WHERE 0". If you want to enforce a "false" value here, use "1 = 2" (or "1=1" if you're trying to emulate "true"...my MySQL brain cell has been lost).
Comments
Comment #1
osopolarAnny news on this? I have the same problem. I tried the approach 1 = 2 in location_views_handler_filter_proximity.inc line 201 (6.x-3.1-rc1). This brings an empty view without errors -- but also in the case where I have a distance of 100km and the zip code filter was equal to one of the nodes. So I'm not sure whats not working ... but something is working wrong.
Comment #2
eataudio commentedI can confirm that this is still a problem, however I was able to change the WHERE clause to "1=0" without any of the side effects mentioned above.
Change was made to line 229 in location_views_handler_filter_proximity.inc (6.x-3.x-dev). I guess let me know if you need/want a patch or if there are any unexpected side effects that anyone else has encountered.
Comment #3
yesct commentedYes, making a patch will better let more people test the solution to see if it causes them problems.
tagging (it's not exactly a conflict with another "module" but that conflict tag might be useful still)
Comment #4
bdragon commentedFixed, thanks.
http://drupal.org/cvs?commit=356920
http://drupal.org/cvs?commit=356922