Conflict between Scale and Geocoder controls in last Leaflet release

Created on 21 June 2023, over 1 year ago
Updated 25 June 2023, over 1 year ago

Problem/Motivation

IMPORTANT NOTICE. I'm not absolutely sure that there is no any influence of Leaflet Layers module on behavior described below, but I can't check it without this module, this experiment needs a lot of changes in my configurations. Nevertheless, there are some evidences that something goes wrong in the Leaflet module itself (see below).

I have several node types on my site with Geofield field in each and Leaflet formatter for these fields. Every such map has different map bundle source from Leaflet Layers, but any has following controls enabled: Layers Control (from Leaflet Layers), Zoom Control (+/- buttons), Reset Control, Locate Control, Fullscreen Control and Geocoder Control.
After upgrade to very last release (10.0.14) and leaving new Scale Control disabled all mentioned controls disappear from map (except Zoom Control). Enabling Scale Control immediately restores all other controls. Disabling Geocoder Control restores all others too, even Scale Control remains disabled.

Shortly:
Scale Control disabled, Geocoder Control enabled - all other controls disappear;
Scale and Geocoder controls enabled - all other controls are visible
Geocoder Control disabled - all other controls are visible regardless of Scale Control state.

There are two important exceptions from this behavior:
A) Leaflet Views, based on the same maps bundles, work normally. Nothing disappears.
B) For anonimous user the visibility of Geocoder Control on my site is disabled (via Roles). And all enabled controls are visible for this user regardless of Scale Control state. Note that Geocoder Control is the only thing that deals with user's permissions. So, controls disappear only for registered user.
This two exceptions make me think that it's all about the Leaflet module.

It should be noted that it is neither "cache issue" (of course every time I totally rebuild cache), nor it is theme influence (this behavior reproduces in any theme I've tried).

Steps to reproduce

1. Create some node type with Geofield and Leaflet formatter with Leaflet 10.0.13 or lower
2. Use Leaflet Layers as maps source. Or you can try custom module, Leaflet More Maps, etc. (this hasn't been tested)
3. Enable all possible controls including Geocoder
4. Upgrade to 10.0.14

My environment is: PHP 8.1.20 and Drupal 10.0.9. But the same was with PHP 8.1.18 and Drupal 9.5.9.

🐛 Bug report
Status

Fixed

Version

10.0

Component

Code

Created by

🇷🇺Russia _kom__

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024