I cannot repro that, please provide steps.
This does it for meâŠ
- Create a location enabled category (all three location settings ticked but I donât know if this makes a difference)
- Create a new topic in the category and add a location to it. The topic displays the Show Map button and if you click it thereâs a marker at the correct location.
- Create a second new topic in the category but donât add a location to it. The topic still displays the Show Map button but if you click on it thereâs no marker, just a blank map.
- I created a third topic with no location and got the same as (3)
- I removed the location from the first topic. The other topics still showed the Show Map button/blank map.
- With the location removed from the first topic I created a fourth topic, again not adding a location. The fourth topic still had a Show Map button leading to a blank map.
- In a different location enabled category I added a new topic without defining a locaton. This topic also had a Show Map button with blank map.
- In a different non-location enabled category (no location settings ticked) I created a new topic, which didnât have the option to add a location, but after saving the topic it had gained a Show Map button leading to a blank map. As this topic is in a non-location enabled category thereâs no way to edit it to remove the location.
Itâs like Iâve got a sticky topic location marker stuck to me! Hopefully you can replicate this.
Iâll take a look when I have time.
I would also be interested if anyone else can replicate this âŠ
I simply canât repro this, the first has a location:
this is my second topic, without:
Note that my user has a location associated with it (which is independent).
This is a development instance, Iâve also checked this in Production.
Are you on tests-passed
?
Could you describe in detail how you created the first location?
If you clear the cache of the browser for this website, can you recreate the problem?
As far as I know Iâm on tests-passed because Iâve never changed the default.
My user had a location associated with it, but I removed it to see if it affected anything. All the tests documented in my previous post (and below) were without a location set for my user.
When it was set, my user location was set by lat/long to get a more accurate location, but the topic tests were either set by finding my location - City=âLayton, Blackpoolâ, blank state and âUnited Kingdomâ and choosing the location with FY3 8JL postcode, or by an approximate set of lat/long coordinates - 53.5N 3.01W I thinkâŠsomewhere near Little Crosby because I mistyped the latitude! When displayed the locations were definitely showing the topic locations and not the previously defined more exact location.
Iâve cleared the cache, cookies and site data for my Discourse sub-domain and after logging back in Iâm still creating topics with the blank map. I then tried a different browser that I donât think Iâve ever accessed my Discourse instance with and that also created new topics with the Show Map button and a blank map.
I then created a new account and didnât set a user location for it. I created a topic with a location which worked as expected (Map with marker) and then created a second topic which didnât get a stored location. This replicates what youâre seeing.
I created a second new user and added a user location to the profile. When I created a new topic the topic location defaulted to the user location (is it supposed to do this?) and the topic location was correctly stored. I then created a second topic, clicked the X against the default location and the topic was stored without a location.
So it looks like itâs something weird thatâs happened to my account. Iâll do some more digging after lunch to see if I can find a way to reset it.
Thatâs super weird. If you have access to rails console, can you also please look at:
TopicCustomField.last(10)
And see if there are locations for the Topics you are seeing issues with in the back end.
This is a topic that shows the map button but no marker on the map. I assume this is saying the topic has a location but the location is ânullâ (or equivalent)?
#<TopicCustomField:0x00007fae3f9838f8
id: 62820,
topic_id: 71985,
name: "location",
value: "{\"geo_location\":\"{}\"}",
created_at: Thu, 20 Jul 2023 09:55:11.188231000 UTC +00:00,
updated_at: Thu, 20 Jul 2023 09:55:11.188231000 UTC +00:00>,
#<TopicCustomField:0x00007fae3f983b78
id: 62821,
topic_id: 71985,
name: "has_geo_location",
value: "t",
created_at: Thu, 20 Jul 2023 09:55:11.188676000 UTC +00:00,
updated_at: Thu, 20 Jul 2023 09:55:11.188676000 UTC +00:00>,
Edit: Just digging furtherâŠin user_custom_fields my account has geo_location = "{}"
Thatâs useful. Thanks.
Away from comp but can you try adding a location to that topic then hitting the clear button?
Adding a location then clearing the location removes the Show Map button and blank map. After clearing TopicCustomField isâŠ
#<TopicCustomField:0x00007fe540801600
id: 62834,
topic_id: 71985,
name: "has_geo_location",
value: "f",
created_at: Thu, 20 Jul 2023 14:48:16.645528000 UTC +00:00,
updated_at: Thu, 20 Jul 2023 14:48:16.645528000 UTC +00:00>,
#<TopicCustomField:0x00007fe5393c3d60
id: 62835,
topic_id: 71985,
name: "location",
value: "{}",
created_at: Thu, 20 Jul 2023 14:48:16.645876000 UTC +00:00,
updated_at: Thu, 20 Jul 2023 14:48:16.645876000 UTC +00:00>]
Ok so thatâs the workaround for now.
If I can repro it Iâll be in a better place to fix it.
Let me know if it keeps happening.
It removes the button from the affected topic, but each new post I create still has the button with blank map (null location)
Feel free to PM me your entire Locations settings
I have a thoughtâŠI was just looking at the location settings again and âlocation topic defaultâ was set to âuserâ. I set that to none and now I can create a topic without a location, or select to add a location if I want one. Iâm not sure why Iâd missed this setting before.
Iâm wondering whether when that option is set to âuserâ the code checks to see if a user has a geo_location custom field. If a user has never set a location then thereâs no custom value and nothing happens, but if it finds the field itâs added to the topic. When youâve set a location and removed it, the geo_location field exists but is set to null. The null value gets applied to the topic which means it gets the button but a blank map.
Iâm also wondering whether the users with null locations and/or topics with no locations are whatâs causing the world map to do odd things because it doesnât expect to see null location values? I think Iâve removed all the locations from the topics where it was probably set to null and the world map is working better, e.g. no scrolling problems so far.
Hello!
We just did an upgrade of our forum, and we are seeing some bugs here and there with the Locations Plugin.
Sometimes, looking at the map inside a discussion with geolocation show a map without the marker. Refreshing the page (shift+maj+r) seems solve the issue.
Showing a map with multiple markers inside a category also show a map without any marker sometimes. Refreshing the page (shit+maj+r) shows some markers, but only 30 of them, instead of hundreds.
Switching between direct URLs to different maps filtered by categories will not update the map. markers from the previous category are shown (with the same bug above, only showing 30 markers instead of hundreds).
I can get all markers to show up at /map
(to our maximum of 1700 markers specified in Settings). Itâs just not working when looking at the map for a specific category.
Everything is up to date. Our last update before that was 3 months ago and everything was fine
If it can help, here is the forum: https://forum.agoramtl.com/
Thank you for your work on this plugin.
Thanks for the report. Iâll take a look at this in time. Please bare with as this appears to be an intermittent non-critical issue and it is a free plugin. PR for fix welcome.
I understand perfectly Iâm very grateful for your work on this plugin.
I donât know if itâs related, but Iâm seeing those errors in our logs, seems related to the map?
ActionView::Template::Error (No route matches {:action=>"map_feed", :controller=>"list"})
app/views/list/list.erb:134
app/views/list/list.erb:132
lib/topic_list_responder.rb:15:in `block (2 levels) in respond_with_list'
lib/topic_list_responder.rb:8:in `respond_with_list'
app/controllers/list_controller.rb:110:in `block (2 levels) in <class:ListController>'
app/controllers/application_controller.rb:420:in `block in with_resolved_locale'
app/controllers/application_controller.rb:420:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:387:in `call'
lib/middleware/gtm_script_nonce_injector.rb:10:in `call'
config/initializers/008-rack-cors.rb:24:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'
EDIT: Yes, this message is appearing when accessing the map and the forum is encountering an error.
Thatâs useful info, thank you.
Is this policy still in place?
No. This is a free plugin so no longer any guarantees on compatibility. Best efforts from us and we expect the community to start to contribute more.
That said, compatibility is tracked and dashboarded at:
So please check there before upgrading: I have been making a particular effort to add test cases for a while.
In reality big breaks will get looked at fairly soon.
Thatâs good to know, thanks!