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

osopolar’s picture

Anny 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.

eataudio’s picture

Version: 6.x-3.0 » 6.x-3.x-dev

I 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.

yesct’s picture

Yes, 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)

bdragon’s picture

Status: Fixed » Closed (fixed)
Issue tags: -Location proximity view, -location conflicts with other modules

Automatically closed -- issue fixed for 2 weeks with no activity.