I am working on a expat community site. Expats have 2 locations and i cannot find a good way to make the user beeing able to submit two locations and display both on the user map.

maybe it is able to integrate that in gmals module

Comments

ray007’s picture

Tack one of the locations on a usernode?

benovic’s picture

never thought of that!

atm im not using usernode. i think i took the wron choice not using it.

bdragon’s picture

Status: Active » Fixed

This is fixed in recent Location 3 snapshots / RCs.

Status: Fixed » Closed (fixed)

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

rares’s picture

Version: 5.x-1.x-dev » 6.x-1.0
Category: feature » bug
Status: Closed (fixed) » Needs review

I am using the latest stable version of location(6.x-3.0) and gmap (6.x-1.0) but am able to see only one location per user at map/user.

I looked at the code and found that the SQL query at line 132 in gmap_location.module is causing this.

I am proposing patching function gmap_location_user_page():

  $result = db_query("
    SELECT
      u.name, MAX(r.rid) as role, i.uid, l.latitude, l.longitude
    FROM
      {users} u
    INNER JOIN
      {location_instance} i
      ON
        u.uid = i.uid
    INNER JOIN
      {location} l
      ON
        i.lid = l.lid
    LEFT JOIN
      {users_roles} r
      ON
        i.uid = r.uid
    WHERE
      u.status = 1
    AND
      (l.latitude != 0 OR l.longitude != 0)
    GROUP BY
      i.uid");

At the very last line, GROUP BY i.uid should be GROUP BY i.lid
This ensures that grouping is done by each location rather than by user. I've tested it on my setup and it works as designed, selecting the highest role ID.

pmark23’s picture

The above patch suggestion fixed it for me.

bdragon’s picture

Status: Needs review » Fixed

Almost.

It *is* possible for multiple users to use the same lid (although there's no UI for accomplishing this at the moment.)

Anyway, I added i.lid to the group by. Thanks.

http://drupal.org/cvs?commit=166605
http://drupal.org/cvs?commit=166606

Status: Fixed » Closed (fixed)

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