# 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:** 11

<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: [April 10, 2021, 6:16pm UTC](https://meta.discourse.org/t/locations-plugin/69742/693 "2021-04-10T18:16:23Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/b/d/bddb479237998f2575de64e2056cf5cf9572755a.jpeg)

👍🏻

---

<div class="post-metadata">

### Author: ![James\_Higginson](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_Higginson](https://meta.discourse.org/u/James_Higginson)
#### Post date: [April 13, 2021, 10:51am UTC](https://meta.discourse.org/t/locations-plugin/69742/694 "2021-04-13T10:51:14Z")

</div>

Did you figure this out?

---

<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: [April 13, 2021, 1:09pm UTC](https://meta.discourse.org/t/locations-plugin/69742/695 "2021-04-13T13:09:52Z")

</div>

User Card based directory breaks the Ember plugin outlet on the User Card. You need to raise it with that component owner.

---

<div class="post-metadata">

### Author: ![James\_Higginson](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_Higginson](https://meta.discourse.org/u/James_Higginson)
#### Post date: [April 13, 2021, 1:18pm UTC](https://meta.discourse.org/t/locations-plugin/69742/696 "2021-04-13T13:18:23Z")

</div>

I’m just trying to get the user location displayed under user posts, is that working?

---

<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: [April 13, 2021, 1:19pm UTC](https://meta.discourse.org/t/locations-plugin/69742/697 "2021-04-13T13:19:13Z")

</div>

User posts? Or User Cards?

---

<div class="post-metadata">

### Author: ![James\_Higginson](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_Higginson](https://meta.discourse.org/u/James_Higginson)
#### Post date: [April 13, 2021, 4:41pm UTC](https://meta.discourse.org/t/locations-plugin/69742/698 "2021-04-13T16:41:49Z")

</div>

Posts, I’m not bothered about cards, is that possible?

---

<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: [April 13, 2021, 4:42pm UTC](https://meta.discourse.org/t/locations-plugin/69742/699 "2021-04-13T16:42:33Z")

</div>

No, we only support Topic level and User locations at present.

---

<div class="post-metadata">

### Author: ![James\_Higginson](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_Higginson](https://meta.discourse.org/u/James_Higginson)
#### Post date: [April 13, 2021, 5:17pm UTC](https://meta.discourse.org/t/locations-plugin/69742/700 "2021-04-13T17:17:21Z")

</div>

Ok that’s unfortunate! My community are very keen on know where people are posting from.

I can’t seem to get it working for user cards either, is that working ok?

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: [April 13, 2021, 5:29pm UTC](https://meta.discourse.org/t/locations-plugin/69742/701 "2021-04-13T17:29:52Z")

</div>

It’s not automated (partly for privacy reasons). A user must explicitly set their location in their profile. They have discretion over what location is picked and therefore where they appear to be.

If you want something more elaborate, we’re probably talking a funded project to implement that #Marketplace

---

<div class="post-metadata">

### Author: ![James\_Higginson](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@James\_Higginson](https://meta.discourse.org/u/James_Higginson)
#### Post date: [April 14, 2021, 7:21am UTC](https://meta.discourse.org/t/locations-plugin/69742/702 "2021-04-14T07:21:34Z")

</div>

Ok thanks, I’ll give that some thought and get back to you, would you be able to display location (of user) below user name on posts for a funded project?

---

<div class="post-metadata">

### Author: ![Zup](https://avatars.discourse-cdn.com/v4/letter/z/c37758/32.png) [@Zup](https://meta.discourse.org/u/Zup)
#### Post date: [April 16, 2021, 3:31am UTC](https://meta.discourse.org/t/locations-plugin/69742/703 "2021-04-16T03:31:14Z")

</div>

So it’s no Follow plugin and [User Card Directory](https://meta.discourse.org/t/user-card-directory/144479) TC for me if I use this Locations plugin, huh? Kind of a bummer, would be great to use all three. What’s the issue, why is the Locations plugin conflicting with them?

---

<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: [April 16, 2021, 6:39am UTC](https://meta.discourse.org/t/locations-plugin/69742/704 "2021-04-16T06:39:29Z")

</div>

Only User Card directory that I’m aware of but incompatibility can and does happen.

For example: someone can override a monolithic template and forget to retain a plugin outlet. We can’t guard against someone doing that. Although the big plugin makers (us, Discourse) are usually very careful not to do that.

---

<div class="post-metadata">

### Author: ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)
#### Post date: [May 20, 2021, 12:58pm UTC](https://meta.discourse.org/t/locations-plugin/69742/705 "2021-05-20T12:58:25Z")

</div>

Are there efforts to make this plugin an official one?

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [June 22, 2021, 10:29pm UTC](https://meta.discourse.org/t/locations-plugin/69742/706 "2021-06-22T22:29:38Z")

</div>

Hello,  
There is an issue with the latest update.[Comparing 83a6ad32...fc0da499 · discourse/discourse · GitHub](https://github.com/discourse/discourse/compare/83a6ad32...fc0da499)  
Thank you! 🙂

> [@Failed rebuild (column directory\_columns.type does not exist)](https://meta.discourse.org/t/failed-rebuild-column-directory-columns-type-does-not-exist/194728):
>
> Hello, I just try to rebuild now and it failed with this error: I, [2021-06-22T21:57:12.240614 #1] INFO – : \> cd /var/www/discourse && su discourse -c ‘bundle exec rake db:migrate’ 2021-06-22 21:57:15.052 UTC [3862] discourse@discourse ERROR: column directory\_columns.type does not exist at character 66 2021-06-22 21:57:15.052 UTC [3862] discourse@discourse STATEMENT: SELECT "directory\_columns"."name" FROM "directory\_columns" WHERE "directory\_columns"."type" IN (0, 2) AND "directory\_columns".…

---

<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: [June 23, 2021, 9:32am UTC](https://meta.discourse.org/t/locations-plugin/69742/707 "2021-06-23T09:32:09Z")

</div>

Hey there, thanks for the report.

Yeah, this is a weird one, and actually I’m not fully convinced it’s Locations fault (although we may be following bad practice?!).

It appears during plugin Initialisation, a Discourse migration was causing the model (actually the Serializer) and the database to be in an inconsistent state.

The solution is really simple:

1. Remove Locations from app.yml
2. Rebuild (the crucial step is the database migration. Once that’s done …) \< – suspect you are here?.
3. Add Locations back into app.yml
4. Rebuild.

🎉

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [June 23, 2021, 11:15am UTC](https://meta.discourse.org/t/locations-plugin/69742/708 "2021-06-23T11:15:57Z")

</div>

Hello Robert,

Excellent 😍 Thank you i uncomment the Locations plugin and the rebuild runs successful. It seems to everything works great. Thanks again for the quick help 🙂

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [June 24, 2021, 10:16pm UTC](https://meta.discourse.org/t/locations-plugin/69742/709 "2021-06-24T22:16:05Z")

</div>

Hi Robert,

Unfortunately the latest update seems to block the Locations Page route `/u/user-map?period=location`. Maybe this commit? [FIX: Always serialize the correct attributes for DirectoryItems (#13510) · discourse/discourse@60a7673 · GitHub](https://github.com/discourse/discourse/commit/60a76737dcbd2004960ae46cca718d916869e3ad)

There are some error in browser console and logs too.

 ![Screenshot 2021-06-25 at 0.06.27](https://global.discourse-cdn.com/meta/original/3X/c/0/c05d435baada5b4c5355101354b8b75e9e8d243c.png)

**info**

```plaintext
NoMethodError (undefined method `each' for nil:NilClass)
app/serializers/directory_item_serializer.rb:41:in `attributes'
app/controllers/application_controller.rb:494:in `serialize_data'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:355:in `call'
config/initializers/008-rack-cors.rb:25:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:177:in `call'

```

**backtrace**

```plaintext
app/serializers/directory_item_serializer.rb:41:in `attributes'

active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'

active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'

active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:89:in `block in _serializable_array'

active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:79:in `map'

active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:79:in `_serializable_array'

active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:73:in `serializable_array'

active_model_serializers (0.8.4) lib/active_model/array_serializer.rb:53:in `as_json'

app/controllers/application_controller.rb:494:in `serialize_data'

plugins/discourse-locations/lib/users_map.rb:15:in `index'

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

actionpack (6.1.3.2) lib/abstract_controller/base.rb:228:in `process_action'

actionpack (6.1.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'

actionpack (6.1.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'

activesupport (6.1.3.2) lib/active_support/callbacks.rb:117:in `block in run_callbacks'

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

i18n (1.8.10) lib/i18n.rb:314:in `with_locale'

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

activesupport (6.1.3.2) lib/active_support/callbacks.rb:126:in `block in run_callbacks'

activesupport (6.1.3.2) lib/active_support/callbacks.rb:137:in `run_callbacks'

actionpack (6.1.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'

actionpack (6.1.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'

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

activesupport (6.1.3.2) lib/active_support/notifications.rb:203:in `block in instrument'

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

activesupport (6.1.3.2) lib/active_support/notifications.rb:203:in `instrument'

actionpack (6.1.3.2) lib/action_controller/metal/instrumentation.rb:33:in `process_action'

actionpack (6.1.3.2) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'

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

actionpack (6.1.3.2) lib/abstract_controller/base.rb:165:in `process'

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

rack-mini-profiler (2.3.2) lib/mini_profiler/profiling_methods.rb:111:in `block in profile_method'

actionpack (6.1.3.2) lib/action_controller/metal.rb:190:in `dispatch'

actionpack (6.1.3.2) lib/action_controller/metal.rb:254:in `dispatch'

actionpack (6.1.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'

actionpack (6.1.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'

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

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

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

actionpack (6.1.3.2) lib/action_dispatch/routing/route_set.rb:842:in `call'

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

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

rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'

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

actionpack (6.1.3.2) lib/action_dispatch/http/permissions_policy.rb:22:in `call'

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

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

config/initializers/008-rack-cors.rb:25:in `call'

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

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

actionpack (6.1.3.2) lib/action_dispatch/middleware/cookies.rb:689:in `call'

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

activesupport (6.1.3.2) lib/active_support/callbacks.rb:98:in `run_callbacks'

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

actionpack (6.1.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'

actionpack (6.1.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'

actionpack (6.1.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'

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

railties (6.1.3.2) lib/rails/rack/logger.rb:37:in `call_app'

railties (6.1.3.2) lib/rails/rack/logger.rb:28:in `call'

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

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

actionpack (6.1.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'

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

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

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

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

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

actionpack (6.1.3.2) lib/action_dispatch/middleware/host_authorization.rb:92:in `call'

rack-mini-profiler (2.3.2) lib/mini_profiler/profiler.rb:384:in `call'

message_bus (3.3.6) lib/message_bus/rack/middleware.rb:61:in `call'

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

railties (6.1.3.2) lib/rails/engine.rb:539:in `call'

railties (6.1.3.2) lib/rails/railtie.rb:207:in `public_send'

railties (6.1.3.2) lib/rails/railtie.rb:207:in `method_missing'

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

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

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

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

unicorn (6.0.0) lib/unicorn/http_server.rb:732:in `worker_loop'

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

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

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

vendor/bundle/ruby/2.7.0/bin/unicorn:23:in `load'

vendor/bundle/ruby/2.7.0/bin/unicorn:23:in `<main>'

```

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: [June 25, 2021, 2:36am UTC](https://meta.discourse.org/t/locations-plugin/69742/710 "2021-06-25T02:36:22Z")

</div>

Thanks for the report. If using Pavilion plugins please avoid upgrading outside our support period as we cannot always be available to resolve breaking changes. I’ll take a look when I’m able.

---

<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: [June 25, 2021, 1:40pm UTC](https://meta.discourse.org/t/locations-plugin/69742/711 "2021-06-25T13:40:28Z")

</div>

@Don OK, I took some time out to fix this today, as I’m really under the gun for some paid work so thought I’d better to get this out of the way 😅

Took me a while, I’m not ashamed to admit, those changes were quite criptic! 😅

The result is this: [COMPATIBILITY: fix for recent major changes to user directory code · merefield/discourse-locations@8a16b16 · GitHub](https://github.com/paviliondev/discourse-locations/commit/8a16b16298c7d371db6c3dade0722edb38c8179d)

It’s possible this might be slightly faster than before as added benefit as I added this further change to take advantage of the new design to reduce the amount of data serialised: [cut down unnecessary data · merefield/discourse-locations@66d0120 · GitHub](https://github.com/paviliondev/discourse-locations/commit/66d0120fb226ea2f0a250c84f6b0cf1989fbe737)

@markvanlan FYI

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [June 25, 2021, 3:06pm UTC](https://meta.discourse.org/t/locations-plugin/69742/712 "2021-06-25T15:06:53Z")

</div>

Hi Robert,  
I really appreciate it. Thank you very much for your work and time. ❤  
Just updated now and tested…everything works great! 🙂

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

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