backdrop-contrib / ip_geoloc

IP Geolocation Views & Maps for Backdrop CMS.
GNU General Public License v2.0
0 stars 2 forks source link

View format settings error #5

Closed pgrayove-mcpl closed 5 months ago

pgrayove-mcpl commented 1 year ago

Cannot edit settings for ip_geoloc "Map (Leaflet API, via IPGV&M)" format. Displays this error:

Error: Call to undefined function leaflet_markercluster_get_library_path() in ip_geoloc_plugin_style_leaflet->options_form() (line 199 of /app/modules/contrib/ip_geoloc/views/ip_geoloc_plugin_style_leaflet.inc).

The view also displays this error:

Warning: in_array() expects parameter 2 to be array, null given in ip_geoloc_generator_ip_geoloc_marker_locations_alter() (line 38 of /app/modules/contrib/ip_geoloc/ip_geoloc_generator/ip_geoloc_generator.module).

pgrayove-mcpl commented 1 year ago

Probably should have listed this error as a separate issue. This error goes away when settings in /admin/config/system/ip_geoloc_generator are not empty/null. Maybe there should be defaults for those settings or a link in the error to the settings.
Warning: in_array() expects parameter 2 to be array, null given in ip_geoloc_generator_ip_geoloc_marker_locations_alter() (line 38 of /app/modules/contrib/ip_geoloc/ip_geoloc_generator/ip_geoloc_generator.module).

pgrayove-mcpl commented 1 year ago

There's some problem between ip_geoloc and leaflet modules causing this error. If I turn off the leaflet markercluster submodule, I can edit the Map (Leaflet API, via IPGV&M) format settings, but then I get this error: Notice: Undefined index: allow_clusters_of_one in ip_geoloc_plugin_style_leaflet->_add_markercluster() (line 703 of /app/modules/contrib/ip_geoloc/views/ip_geoloc_plugin_style_leaflet.inc).

pgrayove-mcpl commented 1 year ago

I should have mentioned that these are the lines referenced in the ip_geoloc_plugin_style_leaflet.inc Line 199: $lib_markercluster = module_exists('leaflet_markercluster') ? leaflet_markercluster_get_library_path() : FALSE; Line 703: '#default_value' => $this->options['allow_clusters_of_one'],

AlexHoebart-ICPDR commented 5 months ago

This issue should be fixed by this PR https://github.com/backdrop-contrib/ip_geoloc/pull/9

laryn commented 5 months ago

That PR has been merged. @pgrayove-mcpl if you are interested in testing, please respond here to verify whether or not this is now solved in the latest code.

pgrayove-mcpl commented 5 months ago

I've tested briefly and it works so far without any errors or issues. There are a lot of map settings in views and custom markers on my site to fully test, but with defaults in place I don't see any problems for the "Map (Leaflet API, via IPGV&M)" format in views. I also have Leaflet markercluster submodule enabled without issues.

laryn commented 5 months ago

Thank you! I'll close this for now, then. If you run into any other issues feel free to reopen or start a new one.