# Locations Plugin 🌍

**URL:** https://meta.discourse.org/t/locations-plugin/69742
**Category:** Plugin
**Tags:** paid-support
**Created:** [September 10, 2017, 10:36am UTC](https://meta.discourse.org/t/locations-plugin/69742 "2017-09-10T10:36:41Z")
**Posts on this page:** 20
**Page:** 22

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 5, 2023, 12:13pm UTC](https://meta.discourse.org/t/locations-plugin/69742/918 "2023-08-05T12:13:17Z")

</div>

[https://github.com/paviliondev/discourse-locations/pull/90](https://github.com/paviliondev/discourse-locations/pull/90)

- FIX: opening the global Topic map directly should not cause an issue
- FIX: transitioning between a Category map and the global map should now work correctly
- Non-functioning WIP map tests

@vincefrommtl, @Stephane_Roy @packman could you please give this update a try? Note the scope of the fixes. Another fix coming soon.

(Technical note: due to Leaflet library being a global object, apparently QUnit cannot see it, so I’ve not been able to provide fully integrated FE tests for these fixes - if anyone knows how I might get Leaflet and QUnit to play together please let me know)

---

<div class="post-metadata">

### Author: ![vincefrommtl](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@vincefrommtl](https://meta.discourse.org/u/vincefrommtl)
#### Post date: [August 6, 2023, 11:55am UTC](https://meta.discourse.org/t/locations-plugin/69742/919 "2023-08-06T11:55:55Z")

</div>

My feedback:

- Transitioning between the global map and a category map is working. **But** the opposite is broken (category map to global map), just like category to category.
- I **have not** seen this error in my log since I upgraded: `ActionView::Template::Error (No route matches {:action=>"map_feed", :controller=>"list"})`. 🙂
- **New bug:** Sometimes, clustered links on the map are only showing the position marker on the map when zoomed in, not the label.
- **New bug:** Sometimes, labels of markers on the map are not linking to the corresponding topic.
- **New bug:** the global map is now affected by the same bug as category maps: only showing a few markers (see below).

Concerning maps that have fewer markers than supposed to: I took a good look at it, and it’s only showing markers for topics active in the last 20 days (or something like that), and a maximum of 30 of them. Is it possible it’s a configuration issue on our forum? It seems very specific! But we did not change anything in those settings. I have a maximum of 1700 _location map max topics_ and I don’t think there is any setting related to time that would lead to only show markers from topics active in the last 20 days?

---

<div class="post-metadata">

### Author: ![packman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packman/32/289322_2.png) [@packman](https://meta.discourse.org/u/packman)
#### Post date: [August 6, 2023, 12:52pm UTC](https://meta.discourse.org/t/locations-plugin/69742/920 "2023-08-06T12:52:40Z")

</div>

After upgrading I opened the global map and there were no markers (topic) displayed. If I edit the location for a topic with a marker and just save with no changes the marker appears. All my markers are over 20 days old so maybe this is the same issue that @vincefrommtl is seeing?

Edit: The Show Map button for each topic still shows the correct marker location when that marker doesn’t display on the global map.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 6, 2023, 1:04pm UTC](https://meta.discourse.org/t/locations-plugin/69742/921 "2023-08-06T13:04:03Z")

</div>

Thanks guys, I’ll take another look.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 6, 2023, 6:49pm UTC](https://meta.discourse.org/t/locations-plugin/69742/922 "2023-08-06T18:49:13Z")

</div>

This is not a full fix but should I believe, restore the old topic locations whilst avoiding the map error when loading directly from an external link or a browser refresh:

[https://github.com/paviliondev/discourse-locations/pull/91](https://github.com/paviliondev/discourse-locations/pull/91)

Known issue: I haven’t solved the direct Map =\> Category Map transition (but this should be an edge case), but everything else should be better.

---

<div class="post-metadata">

### Author: ![packman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packman/32/289322_2.png) [@packman](https://meta.discourse.org/u/packman)
#### Post date: [August 6, 2023, 8:40pm UTC](https://meta.discourse.org/t/locations-plugin/69742/923 "2023-08-06T20:40:17Z")

</div>

I’ll test tomorrow but a user has just pointed out that US locations are now being named as City, Country, State, e.g. Atlanta, US, Georgia

---

<div class="post-metadata">

### Author: ![vincefrommtl](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@vincefrommtl](https://meta.discourse.org/u/vincefrommtl)
#### Post date: [August 6, 2023, 8:54pm UTC](https://meta.discourse.org/t/locations-plugin/69742/924 "2023-08-06T20:54:35Z")

</div>

Quick test: I can confirm that I can see every markers on the map with this new update. Thank you very much. 🙂

For the moment I will advise my users not to jump from one Category Map to another, to bypass the broken transition.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 7, 2023, 7:03am UTC](https://meta.discourse.org/t/locations-plugin/69742/925 "2023-08-07T07:03:03Z")

</div>

The only recent changes are related to the map population.

---

<div class="post-metadata">

### Author: ![packman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packman/32/289322_2.png) [@packman](https://meta.discourse.org/u/packman)
#### Post date: [August 7, 2023, 9:26am UTC](https://meta.discourse.org/t/locations-plugin/69742/926 "2023-08-07T09:26:14Z")

</div>

The country/state order isn’t the very latest version. I mentioned it because I don’t remember seeing that in before the versions of the last couple of days.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 7, 2023, 11:47am UTC](https://meta.discourse.org/t/locations-plugin/69742/927 "2023-08-07T11:47:16Z")

</div>

@packman for now I’ve fixed your earlier issue:

> <https://github.com/merefield/discourse-locations/pull/89>

and this is now covered by tests.

thanks again to @david for getting me out of [the bunker](https://meta.discourse.org/t/strange-qunit-behaviour-test-failing-because-setting-value-doesnt-survive/274165/2) on that one.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [August 9, 2023, 4:46pm UTC](https://meta.discourse.org/t/locations-plugin/69742/928 "2023-08-09T16:46:34Z")

</div>

@merefield Hey just a heads up, the `modify_user_params` method has been deprecated for sometime now, and will be removed soon now that Discourse is on version 3.2.0.beta1-dev

```plaintext
discourse-locations/lib/users_map.rb
35: def modify_user_params(attrs)

```

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/d/3/ad3f286deb71155f31850d947d0486b87f8dd929.png)

Could you work on updating it to use the `users_controller_update_user_params` modifier when you get a chance? Thanks!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 9, 2023, 4:50pm UTC](https://meta.discourse.org/t/locations-plugin/69742/929 "2023-08-09T16:50:22Z")

</div>

sure, thanks for the additional heads up, I’ll look at it this week.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 10, 2023, 7:22pm UTC](https://meta.discourse.org/t/locations-plugin/69742/930 "2023-08-10T19:22:35Z")

</div>

Blake, this is done, mind if I add you as reviewer?

[https://github.com/paviliondev/discourse-locations/pull/92](https://github.com/paviliondev/discourse-locations/pull/92)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [August 10, 2023, 8:16pm UTC](https://meta.discourse.org/t/locations-plugin/69742/931 "2023-08-10T20:16:55Z")

</div>

Awesome, thank you!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 10, 2023, 8:29pm UTC](https://meta.discourse.org/t/locations-plugin/69742/932 "2023-08-10T20:29:43Z")

</div>

Thanks, merged!

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [August 12, 2023, 11:00am UTC](https://meta.discourse.org/t/locations-plugin/69742/933 "2023-08-12T11:00:40Z")

</div>

Sorry to bring bad news, but I have a bug report.

We’re currently running latest, we updated this morning: 3.2.0.beta1-dev ([7ca5ee6cd2](https://github.com/discourse/discourse/commits/7ca5ee6cd2bcde191a192d9c3aa8bb6a6c3a4166))

Running in to a strange issue, which wasn’t present two weeks ago when we last updated, whereby we can no longer edit a user profile if they have custom fields.

I wish to edit this user: [https://example.com/u/username/preferences/profile](https://example.com/u/username/preferences/profile)

Page loads fine:

 ![Screenshot 2023-08-12 at 11.47.00](https://global.discourse-cdn.com/meta/original/4X/9/4/4/944efde2586fb04011fe4a947015e6753750b7e7.png)

As soon as I click on Save, I get an error:

 ![Screenshot 2023-08-12 at 11.39.34](https://global.discourse-cdn.com/meta/original/4X/a/c/f/acfa7f22a2c107f1ce38b87e9e98bd20f73ae365.png)

This came to light because one of our other web sites updates the “membership” custom field when our club members upgrade, and it the Discourse API endpoint was throwing a 500 error.

This is evident when I try to repro using Postman too:

 ![Screenshot 2023-08-12 at 11.48.23](https://global.discourse-cdn.com/meta/original/4X/6/9/9/6994532a50494c0060c4712e25dd5691078a1ee5.jpeg)

The discourse logs show:

 ![Screenshot 2023-08-12 at 11.49.34](https://global.discourse-cdn.com/meta/original/4X/5/8/6/586b0a521a01751bdd37687eb1572a8d7870bc65.png)

and:

```plaintext
plugins/discourse-locations/plugin.rb:188:in `block (2 levels) in activate!'

lib/discourse_plugin_registry.rb:293:in `apply_modifier'

app/controllers/users_controller.rb:2036:in `user_params'

app/controllers/users_controller.rb:198:in `update'

actionpack (7.0.7) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'

actionpack (7.0.7) lib/abstract_controller/base.rb:215:in `process_action'

actionpack (7.0.7) lib/action_controller/metal/rendering.rb:165:in `process_action'

actionpack (7.0.7) lib/abstract_controller/callbacks.rb:234:in `block in process_action'

activesupport (7.0.7) lib/active_support/callbacks.rb:118:in `block in run_callbacks'

app/controllers/application_controller.rb:420:in `block in with_resolved_locale'

i18n (1.14.1) lib/i18n.rb:322:in `with_locale'

app/controllers/application_controller.rb:420:in `with_resolved_locale'

activesupport (7.0.7) lib/active_support/callbacks.rb:127:in `block in run_callbacks'

activesupport (7.0.7) lib/active_support/callbacks.rb:138:in `run_callbacks'

actionpack (7.0.7) lib/abstract_controller/callbacks.rb:233:in `process_action'

actionpack (7.0.7) lib/action_controller/metal/rescue.rb:23:in `process_action'

actionpack (7.0.7) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'

activesupport (7.0.7) lib/active_support/notifications.rb:206:in `block in instrument'

activesupport (7.0.7) lib/active_support/notifications/instrumenter.rb:24:in `instrument'

activesupport (7.0.7) lib/active_support/notifications.rb:206:in `instrument'

actionpack (7.0.7) lib/action_controller/metal/instrumentation.rb:66:in `process_action'

actionpack (7.0.7) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'

activerecord (7.0.7) lib/active_record/railties/controller_runtime.rb:27:in `process_action'

actionpack (7.0.7) lib/abstract_controller/base.rb:151:in `process'

actionview (7.0.7) lib/action_view/rendering.rb:39:in `process'

actionpack (7.0.7) lib/action_controller/metal.rb:188:in `dispatch'

actionpack (7.0.7) lib/action_controller/metal.rb:251:in `dispatch'

actionpack (7.0.7) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'

actionpack (7.0.7) lib/action_dispatch/routing/route_set.rb:32:in `serve'

actionpack (7.0.7) lib/action_dispatch/journey/router.rb:50:in `block in serve'

actionpack (7.0.7) lib/action_dispatch/journey/router.rb:32:in `each'

actionpack (7.0.7) lib/action_dispatch/journey/router.rb:32:in `serve'

actionpack (7.0.7) lib/action_dispatch/routing/route_set.rb:852:in `call'

lib/middleware/omniauth_bypass_middleware.rb:74:in `call'

rack (2.2.8) lib/rack/tempfile_reaper.rb:15:in `call'

rack (2.2.8) lib/rack/conditional_get.rb:40:in `call'

rack (2.2.8) lib/rack/head.rb:12:in `call'

actionpack (7.0.7) lib/action_dispatch/http/permissions_policy.rb:38:in `call'

lib/content_security_policy/middleware.rb:12:in `call'

lib/middleware/anonymous_cache.rb:389:in `call'

lib/middleware/gtm_script_nonce_injector.rb:10:in `call'

rack (2.2.8) lib/rack/session/abstract/id.rb:266:in `context'

rack (2.2.8) lib/rack/session/abstract/id.rb:260:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/cookies.rb:704:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'

activesupport (7.0.7) lib/active_support/callbacks.rb:99:in `run_callbacks'

actionpack (7.0.7) lib/action_dispatch/middleware/callbacks.rb:26:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/show_exceptions.rb:29:in `call'

logster (2.12.2) lib/logster/middleware/reporter.rb:43:in `call'

railties (7.0.7) lib/rails/rack/logger.rb:40:in `call_app'

railties (7.0.7) lib/rails/rack/logger.rb:27:in `call'

config/initializers/100-quiet_logger.rb:20:in `call'

config/initializers/100-silence_logger.rb:29:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/request_id.rb:26:in `call'

lib/middleware/enforce_hostname.rb:24:in `call'

rack (2.2.8) lib/rack/method_override.rb:24:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/executor.rb:14:in `call'

rack (2.2.8) lib/rack/sendfile.rb:110:in `call'

actionpack (7.0.7) lib/action_dispatch/middleware/host_authorization.rb:131:in `call'

message_bus (4.3.7) lib/message_bus/rack/middleware.rb:60:in `call'

lib/middleware/request_tracker.rb:233:in `call'

railties (7.0.7) lib/rails/engine.rb:530:in `call'

railties (7.0.7) lib/rails/railtie.rb:226:in `public_send'

railties (7.0.7) lib/rails/railtie.rb:226:in `method_missing'

rack (2.2.8) lib/rack/urlmap.rb:74:in `block in call'

rack (2.2.8) lib/rack/urlmap.rb:58:in `each'

rack (2.2.8) lib/rack/urlmap.rb:58:in `call'

unicorn (6.1.0) lib/unicorn/http_server.rb:634:in `process_client'

unicorn (6.1.0) lib/unicorn/http_server.rb:739:in `worker_loop'

unicorn (6.1.0) lib/unicorn/http_server.rb:547:in `spawn_missing_workers'

unicorn (6.1.0) lib/unicorn/http_server.rb:143:in `start'

unicorn (6.1.0) bin/unicorn:128:in `<top (required)>'

vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `load'

vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `<main>'
```

Strangely, I can edit my OWN profile and update the custom user fields just fine.

But I can no longer edit any other user, and neither can `system` perform the updates through our API either.

If I disable the Locations plugin, everything works fine again:

 ![Screenshot 2023-08-12 at 11.54.31](https://global.discourse-cdn.com/meta/original/4X/9/7/3/9736a6af6b4443726b3ccfd93fb41cfa7b472de9.jpeg)

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 12, 2023, 11:08am UTC](https://meta.discourse.org/t/locations-plugin/69742/934 "2023-08-12T11:08:49Z")

</div>

@Richie thanks for your report.

I can reproduce this.

It only seems to happen when someone does _not_ have a location.

This code was recently refactored due to a deprecation in core and I’ve missed (a pretty big) case.  
I’ll patch it soon.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [August 12, 2023, 11:41am UTC](https://meta.discourse.org/t/locations-plugin/69742/935 "2023-08-12T11:41:41Z")

</div>

> [@merefield](#):
>
> only seems to happen when someone does _not_ have a location.

Ah, so maybe me editing my own profile successfully was a red herring, as I do have a location on mine 🙂

> [@merefield](#):
>
> I’ll patch it soon

No worries, thanks for the continued support 🙂

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 12, 2023, 1:10pm UTC](https://meta.discourse.org/t/locations-plugin/69742/936 "2023-08-12T13:10:55Z")

</div>

I believe that should be fixed now:

[https://github.com/paviliondev/discourse-locations/pull/94](https://github.com/paviliondev/discourse-locations/pull/94)

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [August 13, 2023, 6:54am UTC](https://meta.discourse.org/t/locations-plugin/69742/937 "2023-08-13T06:54:45Z")

</div>

> [@merefield](#):
>
> I believe that should be fixed now

Update this morning, no more HTTP/500 errors.

Thanks for the speedy fix Robert 😃 👏

[Previous page](https://meta.discourse.org/t/locations-plugin/69742.md?page=21)

[Next page](https://meta.discourse.org/t/locations-plugin/69742.md?page=23)
