I am seeing the following error with the GMap module when creating a view:

user warning: Unknown column 'users_roles.rid' in 'field list' query: SELECT location.lid AS lid, location.latitude AS location_latitude, location.longitude AS location_longitude, location.latitude AS gmap_lat, location.longitude AS gmap_lon, users_roles.rid AS gmap_role_marker FROM location location LIMIT 0, 10 in /var/www/drupal-6.20/sites/all/modules/views/includes/view.inc on line 771.

I am not sure if this is a problem with GMap, or with Views.
I am using Views 6.x-2.12

Comments

mkmk’s picture

I also created an issue under GMap, in http://drupal.org/node/1157962

erindarri’s picture

Just adding another example/info. I was using this and got the same error. It appeared to have started when I changed Format | gMap | Settings | Marker Handling to "By User Role (for user views)" and has disappeared since I changed it to Single Marker type.

Xomby’s picture

Version: 6.x-1.1 » 7.x-2.x-dev

Still an issue in 7.x - which is a direct port of the 6.x branch, I understand.

The issue is caused by using a GMAP style view with markers by user role on a view that is showing nodes. This is hardcoded into gmap_plugin_style_gmap.inc on line #71:

    elseif ($this->options['markers'] == 'userrole') {
      $this->view->query->add_field('users_roles', 'rid', 'gmap_role_marker');
    }

I suspect this is because a "node" object doesn't have a user role entry, whereas a user does.
This line (above) needs to somehow take into consideration whether we're looking at a user node or another content type, and extrapolate the RID from the node's author's user node.

Found this same line in gmap_plugin_style_gmapextended.inc as well on line #83:

    else if ($this->options['markers'] == 'userrole') {
      $this->view->query->add_field('users_roles', 'rid', 'gmap_role_marker');
    }

Will update with anything I find.

So far this (at least for me) doesn't work even with a user view... and for the life of me I can't get the views 3 query to include the user_roles table in a join of any kind (which would probably solve the problem in the first place). nevemind, started removing "fields" from the view and suddenly it worked again... WTTTTTFFFFFF

OOOK so I got this to work properly, but i'm too burnt out right now to explain it, will edit this post and/or add details later today (2:20a right now).