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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

masher’s picture

Try checking "Disable javascript with Views" in DEBUGGING

/admin/structure/views/settings/advanced

I had similar problems with Leaflet & Views

Simon Georges’s picture

Maybe the Leaflet formatter should be removed from the Views configuration option, to be sure?

beckyjohnson’s picture

I 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.

levelos’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)
2pha’s picture

I am getting this when setting the formatter of a geofield field in the views interface.
After clicking apply a modal window with this appears.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: http://localhost/mysite/admin/structure/views/ajax/config-item/maps/page...
StatusText: OK
ResponseText:
( ! ) SCREAM: Error suppression ignored for
( ! ) Fatal error: Unsupported operand types in E:\wamp\www\mysite\includes\form.inc on line 2672
Call Stack
#TimeMemoryFunctionLocation
10.0002807856{main}( )..\index.php:0
20.229443206472menu_execute_active_handler( )..\index.php:21
30.237445356304call_user_func_array
( )..\menu.inc:517
40.237445357056views_ui_ajax_form( )..\menu.inc:517
50.238345483984views_ajax_form_wrapper( )..\admin.inc:2943
60.238745504392drupal_build_form( )..\ajax.inc:236
70.264648737712drupal_process_form( )..\form.inc:385
80.264648740488form_builder( )..\form.inc:885
90.264748749032form_builder( )..\form.inc:1906
100.274549076160form_builder( )..\form.inc:1906
110.276249137288form_builder( )..\form.inc:1906
120.277349174520form_builder( )..\form.inc:1906
130.277549185832form_process_select( )..\form.inc:1850

2pha’s picture

Version: 7.x-1.0-beta1 » 7.x-1.1
Status: Closed (cannot reproduce) » Active
2pha’s picture

It only seems to happen if you select 'leaflet' as a formatter of a field in views.

keesje’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

I 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.

keesje’s picture

robertwb’s picture

FileSize
707 bytes

Hey @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.

robertwb’s picture

Priority: Normal » Major
Status: Active » Reviewed & tested by the community
keesje’s picture

Thanx Robert!

jweirather’s picture

I 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:

"Most of the Views UI won't work, but the pager type and settings did. Set the pager type to only show a specified number of results, and set the settings number to 1. Make all your changes, then reset the pager to what you want just prior to saving that final version."

I will also try this patch and see if it fixes the issue I'm having.

jamestombs’s picture

Patch in #10 fixed this for me.

weavie’s picture

#10 worked for me.

scotwith1t’s picture

Another +1 for this patch. Critical. Thank you!!! Let's get this committed?

clemens.tolboom’s picture

Patch works as advertised.

  • RdeBoer committed c9070d9 on 7.x-1.x authored by robertwb
    Issue #1796656 by keesje, robertwb: Selecting Leaflet field formatter in...
RdeBoer’s picture

Committed.
Thanks keesje & Robertwb.
Rik

RdeBoer’s picture

Assigned: Unassigned » RdeBoer
Status: Reviewed & tested by the community » Fixed

Available in 7.x-1.x-dev now and in 7.x-1.2 when released.

robertwb’s picture

Thanks @RdeBoer and @keesje!!!

robertwb’s picture

Status: Fixed » Closed (fixed)