I should add the new quick find current location target button on the location selector works for Topic locations too if you disable location input fields.
array_for_fix.each do |id|
Locations::UserLocationProcess.upsert(id)
end
The other way this can be fixed is manually re-entering the user map location, so basically future user location edits will simply overwrite the bad data.
Apologies for the inconvenience.
If anyone wants to write a migration or rake task, PR welcome.
After a user publishes a thread or reply, automatically detect the location based on their current IP address and display it below their avatar in the thread/post—instead of requiring users to manually select it or set it in their profile.
Involuntary update of user location would be a big departure for this plugin as to date it’s been reliant on voluntary submission and therefore individual user buy-in.
But I can see the case for it. It would make gathering user location much more reliable and less dependent on user action.
There’s already a Post label for user location on every Post. So I think this part is already covered.
I think automated update of user location as a site option during posting is feasible and reasonable so long as:
Sites update their T&C’s
The location is sufficiently approximate, perhaps to the nearest city? To me tracking people to the street is unlikely to endear users to the site! Perhaps you’d want an option to set granularity to city, province (if generally feasible via data) or country. I’d be interested in other admin’s opinions about this.
It would be optimal if we could standardise on MaxMind, which is the standard IP Geolocation service native to Discourse core.
I would be happy to consider sponsorship to add back end automation as a site option. I’ll contact you via PM to see if we can reach agreement.
This is not a simple lookup, we do more than that - this will allow you to set a specific granularity (e.g. city) for all automatically determined locations in order to protect user privacy whilst increasing community trust.
(Yes, there will be some issues with VPNs and I’m afraid we can’t easily overcome that).
Once I’m satisfied this is working sufficiently well I will merge it.
It sits behind a feature flag in any case.
I’ll keep you posted, but exciting times, this is potentially one of the best additions to Locations we may have had for a while.