Locations Plugin

We can assume that’s “Roadmap”, ie an option to automate location via IP with the ability for individual users or a site to opt out.

But I have no intention of developing that for free.

It would need funding (or a high quality PR with the right technical choices and tests).

It’s been requested before, but no-one has ponied up sufficient funding.

1 Like

Sorry for slow response!

  • how to reproduce reliably, can you provide exact steps?
  • what version of Discourse are you using?
  • what do you see in the HTML (using inspector)
  • do you see any error messages in console or log?
  • what is recorded in the User Custom Field for geo_location? Take a look at /u/<username>.json

I’ve been using this wonderful plugin for years.

Recently I’ve been facing a difficulty. When I’m creating a new topic, and try to add a location to it, e.g. Bathinda, and search the same in new topic dialouge, it gives correct/expected results.

But when I search another city ‘Patiala’ (both cities are districts in the same Indian state Punjab, both show correctly when searched in OpenStreetmap), it gives out blank results/can’t search.

And this happens with other districts/cities also. In some cases, those searched districts are very big and famous cities, yet they’re not found, but smaller less known cities are found.

What could be the reason?

Interesting. Do you get the same issue with other geocoding providers?

1 Like

I couldn’'t choose any other provider because ‘Nominatim’ was defaut/easiest to configure. If I chose any other provider, it gave an error:

But after you gave this idea, I searched and found a way to get an Api key for OpenCageData (took 2 minutes) and after I filled that api key in the plugin’s settings (and only after filling the api key, changed the provider name to OpenCageData). And lo and behold, it not only stopped giving that error, the original problem of not able to search and find ‘Patiala’ (and many other cities) also disappeared.

And so, ALL IS OK NOW. THANKS!

P.S. I wish that the link ‘Provider Details’ showing below the ‘red-color’ error should’ve sent me/any user to that providers page (instead of ‘GitHub’ page), where user could demand ‘Api-Key’ generation. That would’ve been a lot of big help.

1 Like

That’s static so I don’t believe that’s going to be possible. PR welcome!

Glad you are sorted!

1 Like

Hello, I just want to show the country’s flag, is it possible with this plugin or is it only to show the location via GPS?

1 Like

By configuring this plugin’s settings, you can make it choose any one location (hopefully any one country also) to be set as all new topic’s location. That way that location would always display on all the subsequent topics (while composing the topic, if any user wished to change that country name/location, he’d be free to do so).

Hello, Is there any chance to fix this issue? Thanks :slightly_smiling_face:

2 Likes

I’ve reproduced it. I’ll take a look this week.

Sorry, paid gigs come first :sweat_smile:

3 Likes

@Don can you try that update please?

1 Like

Thanks so much Robert :hugs: Now it seems works fine but I have noticed when I go to an other user profile (who didn’t set up location) from e.g summary then it appears to the same behavior. If I go to a profile from the home page or from other parts of the site then it works great. This is maybe because of the loading slider.

1 Like

Can you elaborate, what exactly are you clicking to make that transition? (from presumably, summary to summary?). Do both users needed to have had a location at some point? Does the first user have a populated location? In short, exact repro steps please :slight_smile:

Yeah that’s correct. The same behavior happens everywhere in /u/ if you go to an other user summary who didn’t set up location.
For example:

Wait I send you a video in PM about the exact issue. :slightly_smiling_face:

1 Like

Ah no worries, have repro’d.

Yeah, not great.

I think this will need a refactor into glimmer at some point.

Given this is an edge case I’ll probably not get around to that very soon, apologies.

1 Like

This reminds me of Birthday cake emoji displayed on profile when its not your birthday & Wrong number of user notes

2 Likes

Yeah, good catch @Moin !

I’m wondering if there is something more fundamental going wrong here :thinking:

btw, excellent edge case catching both of you!

2 Likes

OK what this looks like is that the code is not re-evaluated after transition, because setupComponent is not firing again.

This is almost certainly a general problem not specific to Locations.

I suspect the solution is to use some kind of {{did-update}} modifier in Glimmer. But that will only work if Ember considers the data state “dirty” :thinking:

3 Likes

@Don OK I’ve moved that to Glimmer now (spot the horrendous typo in the commit comment :sweat_smile: ) and it might work better now, let me know how you get on!

(FYI dev note: getters were enough for the profile change-over but there was still the (unfortunately necessary?) class modification with dom manipulation that required a modifier)

3 Likes

Wonderful :heart_eyes: Thanks so much Robert, works awesome :hugs:

2 Likes