Compatibility with Leaflet ^10

Created on 2 June 2023, about 1 year ago
Updated 25 July 2023, 11 months ago

Problem/Motivation

Installing leaflet_maptiler brings leaflet:^2 as dependency.
Upgrading Leaflet to v10 is not allowed by composer.
The leaflet_maptiler decorator for leaflet service also lacks of the a new argument cache

Steps to reproduce

composer require 'drupal/leaflet_maptiler:^1.0@beta'
composer require 'drupal/leaflet:^10.0'  

Proposed resolution

Add decorator argument
Update compatibility in composer.json

Remaining tasks

Probably we can apply this pattern: https://www.previousnext.com.au/blog/safely-extending-drupal-8-plugin-cl...

User interface changes

No

API changes

No

Data model changes

No

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇺Australia elgandoz Canberra

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

Comments & Activities

  • Issue created by @elgandoz
  • @elgandoz opened merge request.
  • 🇦🇺Australia elgandoz Canberra
  • 🇹🇷Turkey Orkut Murat Yılmaz

    Hello all,

    I've tried to apply @elgandoz's MR as a patch, but it didn't work at all.

    I'm changing the status of the issue as "needs work".

    Best,
    Orkut

  • Status changed to Needs work about 1 year ago
  • Status changed to RTBC about 1 year ago
  • 🇹🇷Turkey Orkut Murat Yılmaz

    Hello again,

    I've reinstalled my D10.1.0 environment and then leaflet module too. After that, I manually downloaded the leaflet_maptiler module files and implemented the @elgandoz's code on the module. This time module is installed without an error. Now I'm testing my Maptiler connection, I'll report about it, if I face an error.

    Thank you @elgandoz for your contribution. I think that the MR deserves an approval and merge. So that, I'm changing the status as RTBC:)

    Best,
    Orkut

  • Status changed to Needs work 12 months ago
  • 🇹🇷Turkey Orkut Murat Yılmaz

    I've tested with my Maptiler API Key today and then created a content type with a geofield. When I go to manage form display settings of that content type, I choose "leaflet map" as the display widget and then I receive a WSOD with the error code which I paste below:

    TypeError: Drupal\leaflet_maptiler\MaptilerLeafletServiceDecorator::__construct(): Argument #9 ($cache) must be of type Drupal\leaflet_maptiler\CacheBackendInterface, Drupal\Core\Cache\DatabaseBackend given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\leaflet_maptiler\MaptilerLeafletServiceDecorator->__construct() (line 55 of /var/www/html/web/modules/contrib/leaflet_maptiler/src/MaptilerLeafletServiceDecorator.php).

    Unfortunately, I'm switching the issue's status as "needs work".

    Best,
    Orkut

  • 🇧🇪Belgium bernardopaulino Brussels

    I've merged the PR provided in #2 so that we are able to download the leaflet 10.x.
    I still didn't have time to look at the issue from #7 so for now the status remains as "needs work".

  • 🇧🇪Belgium bernardopaulino Brussels

    Patch from #2 committed in version 8.x-1.0-beta12.

  • Issue was unassigned.
  • Status changed to Needs review 12 months ago
  • 🇧🇪Belgium bernardopaulino Brussels

    Orkut,
    Concerning your comment #7, I couldn't reproduce the issue. I checked the decorator MaptilerLeafletServiceDecorator defined in the leaflet_maptiler module in the version 8.x-1.0-beta12 and it seems to comply with same arguments as the decorated service LeafletService when using the leaflet version 10.0.16.

    Can you please update your leaflet_maptiler and leaflet modules to the latest versions and check if the error persists?

    Thank you!

  • Status changed to RTBC 12 months ago
  • 🇹🇷Turkey Orkut Murat Yılmaz

    Hello again,

    After a clean install, it worked smoothly.

    Thanks for everything.

    Best,
    Orkut

  • Status changed to Fixed 11 months ago
  • 🇧🇪Belgium bernardopaulino Brussels

    Thank you Orkut for your feedback.
    Since the compatibility with Leaflet 10 is now fixed, I will then change the status of this issue to fixed.

    Thank you all for the support :)

  • Status changed to Fixed 11 months ago
  • 🇧🇪Belgium bernardopaulino Brussels
Production build 0.69.0 2024