On my installation I get the following error:

user warning: Unknown column 'openlayers_proximity.distance' in 'field list' query:
SELECT
  node.nid AS nid,
  node.title AS node_title,
  node.type AS node_type,
  node.vid AS node_vid,
  openlayers_proximity.distance AS unknown
FROM node node
  RIGHT JOIN openlayers_proximity openlayers_proximity ON node.nid = openlayers_proximity.nid
  LEFT JOIN content_type_heim_verzeichnis node_data_field_heim_anschrift ON node.vid = node_data_field_heim_anschrift.vid
WHERE node.type in ('heim_verzeichnis')
GROUP BY nid, unknown, node_title, node_type, node_vid, field_heim_geo_geo_astext ORDER BY unknown ASC in /WEBSITES/[...]/sites/all/modules/views/includes/view.inc on line 775.

This happens when the location of the exposed filter is not set to a value. This leads to openlayers_proximity_handler_field::query() not setting any field. So views takes distance as field and unknown as alias.

For avoiding this behaviour we can use the real_field and fall back on the views default handler.
Therefore see the attached patch, this resolved this special issue.

CommentFileSizeAuthor
#1 1001100-2.patch1.58 KBderhasi
unknown_column_distance.patch1.94 KBderhasi

Comments

derhasi’s picture

StatusFileSize
new1.58 KB

Hm, the real field is used to get the field, that delivers the distance value, not good. o the rendered output is wrong.

The patch attached solves this issue for the moment, but there is more to do (use alias and co in a consistent way).

dagomar’s picture

Neither patch worked for me :(

Also, when I do have values in the exposed filter, after i click the sort on distance, the view is empty.

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -unknown column, -views handler, -openlayers_proximity, -views field

I am closing this issue, since it is for a Drupal version that is no longer supported. Please re-open this issue if it is relevant for a project release for a supported Drupal version.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.