Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How to reproduce:
1. Create a new view with a Leaflet Map display
2. Add a Geofield field to the View, as required for the display settings
3. Select the "Leaflet" formatter for that field
4. Everything breaks. It is now impossible to edit the View, and the page does not display.
Clearly, you are not supposed to select the Leaflet field formatter to create Leaflet Map Views, but this was not obvious to me without documentation, and I came very close to giving up and going with OpenLayers. This should either be documented, or give some kind of warning in Views.
Comment | File | Size | Author |
---|---|---|---|
#10 | drupal-1796656-9.patch | 707 bytes | robertwb |
#9 | leaflet_views_options_empty-1796656-9351261.patch | 706 bytes | keesje |
Comments
Comment #1
masher CreditAttribution: masher commentedTry checking "Disable javascript with Views" in DEBUGGING
/admin/structure/views/settings/advanced
I had similar problems with Leaflet & Views
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedMaybe the Leaflet formatter should be removed from the Views configuration option, to be sure?
Comment #3
beckyjohnson CreditAttribution: beckyjohnson commentedI have this problem to and I have no idea how to resolve it. No matter what I do, every leaflet map in combination with geo field is blank or it breaks the view.
Comment #4
levelos CreditAttribution: levelos commentedComment #5
2phaI am getting this when setting the formatter of a geofield field in the views interface.
After clicking apply a modal window with this appears.
Comment #6
2phaComment #7
2phaIt only seems to happen if you select 'leaflet' as a formatter of a field in views.
Comment #8
keesje CreditAttribution: keesje commentedI ran into this or a similar issue and traced it down to the "Marker field" in the leaflet formatter for views.
The issue in my case is that the "#options" value was empty and treated as NULL, making form_process_select() fail.
Underlying issue seems that there are no fields available to handle as "to use as output for a map marker", thus resulting in an empty value.
A fix or workaround for me was to add (array) to at least force the value to be an empty array.
PHP version differences could be at play here.
Comment #9
keesje CreditAttribution: keesje commentedComment #10
robertwb CreditAttribution: robertwb commentedHey @keesje - this patch worked for me, though it was done in a slightly different format than I am used to. It appears that the patch was generated from the "modules/" directory instead of "modules/leaflet", so when applying the patch you need to be in the "modules" dir instead of "modules/leaflet".
I have always done it from inside the module dir itself - so I uploaded a new copy, and will let the project admins decide how to proceed. Nevertheless, I will mark this is reviewed.
Comment #11
robertwb CreditAttribution: robertwb commentedComment #12
keesje CreditAttribution: keesje commentedThanx Robert!
Comment #13
jweirather CreditAttribution: jweirather commentedI am having a very similar issue, and separately came up with a workaround. This is for a view containing a geofield, which is set to leaflet map, and which appears to render the Views UI unusable. In my case, clicking some Views UI options would only show the throbber for a moment and seemingly die off, sometimes javascript would be dumped to the window, in some cases nothing would respond at all. In my case, the problem only seemed to surface if there were multiple results returned to the Views UI preview area, in which case only the first map or two in the list would be rendered. This is what led to my workaround.
It may be specific to my use case, but I wanted to get this workaround into the issue queue:
I will also try this patch and see if it fixes the issue I'm having.
Comment #14
jamestombs CreditAttribution: jamestombs commentedPatch in #10 fixed this for me.
Comment #15
weavie CreditAttribution: weavie commented#10 worked for me.
Comment #16
scotwith1tAnother +1 for this patch. Critical. Thank you!!! Let's get this committed?
Comment #17
clemens.tolboomPatch works as advertised.
Comment #19
RdeBoerCommitted.
Thanks keesje & Robertwb.
Rik
Comment #20
RdeBoerAvailable in 7.x-1.x-dev now and in 7.x-1.2 when released.
Comment #21
robertwb CreditAttribution: robertwb commentedThanks @RdeBoer and @keesje!!!
Comment #22
robertwb CreditAttribution: robertwb commented