Locations Plugin

:+1:t2:

4 Likes

Did you figure this out?

1 Like

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

1 Like

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

User posts? Or User Cards?

Posts, Iā€™m not bothered about cards, is that possible?

2 Likes

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

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

1 Like

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

1 Like

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?

2 Likes

So itā€™s no Follow plugin and User Card Directory 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?

2 Likes

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.

3 Likes

Are there efforts to make this plugin an official one?

1 Like

Hello,
There is an issue with the latest update.Comparing 83a6ad32...fc0da499 Ā· discourse/discourse Ā· GitHub
Thank you! :slight_smile:

3 Likes

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.

:tada:

3 Likes

Hello Robert,

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

2 Likes

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

There are some error in browser console and logs too.

info

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

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! :slight_smile:

3 Likes

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.

3 Likes

@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 :sweat_smile:

Took me a while, Iā€™m not ashamed to admit, those changes were quite criptic! :sweat_smile:

The result is this: COMPATIBILITY: fix for recent major changes to user directory code Ā· paviliondev/discourse-locations@8a16b16 Ā· GitHub

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 Ā· paviliondev/discourse-locations@66d0120 Ā· GitHub

@markvanlan FYI

5 Likes

Hi Robert,
I really appreciate it. Thank you very much for your work and time. :heart:
Just updated now and testedā€¦everything works great! :slight_smile:

5 Likes