This latest D8 version has not been very guarded (at all) and has become a real headache figuring out which version to install and which patches to apply to have a really working version that easily install with:

$ composer require drupal/leaflet

The attached patch wants to cover all this.
It applies to the actual 8.x-1.0-beta1 version of the module, covers all the actual 8.x-1.x dev enhancements
and include also the following existing (and not yet committed) patches:

I hope this might help a solid acceleration for the release of a stable and more usable version of this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

itamair created an issue. See original summary.

itamair’s picture

The patch should be applied using and following this composer plugin workflow: https://github.com/cweagans/composer-patches

As you can see in the related patch, it adds the following lines in the leaflet composer.json:

  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "leaflet/leaflet",
        "version": "v0.7.7",
        "type": "drupal-library",
        "dist": {
          "url": "https://github.com/Leaflet/Leaflet/archive/v1.0.3.zip",
          "type": "zip"
        }
      }
    }
  ],
  "require": {
    "leaflet/leaflet": "^1.0.3"
  }

When committed in the module it will work properly,
but I am not totally sure as a patch it would be able to apply that patch adds-on and download/install the leaflet/leaflet library dependency at the same time.
If you don't find the leaflet/leaflet library installed too at the end of your "composer require drupal/leaflet" process, then you should and follow what is now advised in the actual 8.x-1.x:dev readme.txt file, and it means the following:

2. Add the proper repository to your composer.json file to be able to require
   the JS library:
    {
      "type": "package",
      "package": {
        "name": "leaflet/leaflet",
        "version": "1.0.3",
        "type": "drupal-library",
        "dist": {
          "url": "https://github.com/Leaflet/Leaflet/archive/v1.0.3.zip",
          "type": "zip"
        }
      }
    }

3. Run $ composer require leaflet/leaflet:~1.0
rickvug’s picture

@itamair Have you tried contacting the maintainer of the module to see if you could be added as a maintainer? It looks like you're doing a lot of great work here. The issues listed badly need to be resolved so that D8 devs can use this important module in a proper best practice composer workflow.

itamair’s picture

ah right ... it might be a lot easier if I have granted maintainer privileges on Leaflet.
I will now try to write to RdeBoer ...

levelos’s picture

@itamir, thanks for all your support on this module. You've been added as a maintainer.

itamair’s picture

This has been included in the last 1.x-dev

  • itamair committed 3679e80 on 8.x-1.x
    Issue #2926593 by itamair: Major Patch for a really working Drupal 8.x-1...
ken-g’s picture

Status: Needs review » Reviewed & tested by the community

I have been using the D8 version of the Leaflet module for several months now, and I have only ever installed it using composer, always without any problems. Given that we are now on a stable release of 8.x-1.3, as far as I am concerned, this issue has been reviewed and tested.

anruether’s picture

Status: Reviewed & tested by the community » Fixed

This seems to be fixed a loooong while ago.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.