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!