Problem/Motivation

The dropzonejs version 6 release changed the filename of the dist file from dropzone/dist/min/dropzone.min.js to dropzone/dist/min/dropzone-min.js.

Steps to reproduce

Install dropzonejs < 6 via npm-asset/dropzone or enyo/dropzone using composer.
Get an error on install:

  Dropzone library missing:<br /><br />Dropzonejs requires the dropzone.min.j  
  s library.                                                                   
          Download it (https://github.com/dropzone/dropzone) and place it in   
  the                                                                          
          libraries folder (/libraries)

Proposed resolution

This module should support all available versions or announce a proper dependency constraint.
Align js_candidates to be more resilient.

Issue fork dropzonejs-3424947

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

volkerk created an issue. See original summary.

volkerk’s picture

berdir’s picture

Ah, I see. I don't think dropzone/dist/min/dropzone-min.js is needed, as you can see, that's inconsistent between the requirements check and the library alter.

Probably enough to align it.

The difference is whether or not you keep the dist folder, actually. See the output from CI with version 5:

```
$ curl -L https://github.com/dropzone/dropzone/releases/download/$DROPZONE_VERSION/dist.zip -o dropzone.zip --silent
$ unzip dropzone.zip
Archive: dropzone.zip
creating: dist/
inflating: dist/basic.css
inflating: dist/dropzone.js
inflating: dist/dropzone-amd-module.js
creating: dist/min/
inflating: dist/min/dropzone.min.css
inflating: dist/min/basic.min.css
inflating: dist/min/dropzone-amd-module.min.js
inflating: dist/min/dropzone.min.js
inflating: dist/dropzone.css
$ mv dist dropzone
```

this then doesn't move dist inside dropzone, it renames it. That's also what you get when using the new recommended composer repositories.

I would suggest adjusting your build process to that, but it was definitely my intention to provide BC for the existing path and I failed at that.

volkerk’s picture

Status: Active » Needs review

Ah, okay. Aligned the MR to use only the variant with dist and dot

berdir’s picture

I'm not sure what's up with the test fail, can't reproduce locally.

alabandit’s picture

this patch seems to work. thank you!

amjad1233’s picture

StatusFileSize
new520 bytes

Good old patch!

nicodh’s picture

StatusFileSize
new1.34 KB

I suggest to allow more options: I try to install using composer require npm-asset/dropzone, and library is not detected.
Attach a patch that fixes also js / css detection in library alter (not only in requirements check).

volkerk’s picture

Added check for libraries/dropzone/dist/min/dropzone.min.js in the test.
I am not sure for which library version / distribution libraries/dropzone/dropzone-min.js is applicable.

The module folder is concatenated with issue number in mr tests, therefore removed relevant part. See https://git.drupalcode.org/issue/dropzonejs-3424947/-/jobs/973387#L209

berdir’s picture

Ah yes, the module folder, that makes sense, so it wasn't caused by this change, would happen with any issue/fork merge request. Strange that I didn't get that when I tested it initially, that was also a fork.

Will commit and release an update asap.

  • Berdir committed 9a49b6d3 on 8.x-2.x authored by volkerk
    Issue #3424947 by rkcreation: Fix detection of dropzonejs dist files for...
berdir’s picture

Status: Needs review » Fixed

Merged.

berdir’s picture

@rkcreation: I missed your patch between all the other comments. Contributions must be done as merge requests now. I suggest you create a new issue to extend the options.

nicodh’s picture

My patch works with `composer require npm-asset/dropzone:^6@beta`: we needs 'dropzone/dist/dropzone-min.js' and 'dropzone/dist/dropzone.css'.

I also try with merge-plugin, merging plugin's composer.libraries.json, so installing enyo/dropzone (5.7.2).

* merge-plugin composer.libraries.json (enyo/dropzone 5.7.2) : OK
* repositories of root composer.json + enyo/dropzone 5.7.2 : OK
* npm-asset/dropzone:^6@beta : NOK
* npm-asset/dropzone:^5 (5.9.3) : OK

IMHO, I prefer npm-asset/* method, it seems more friendly for updates etc. See https://www.drupal.org/project/select2 for example.

I will try to find some time to do a merge request.

berdir’s picture

@rkcreation: I'm not saying your change isn't useful, I really just missed it and as mentioned, contributions need to be merge requests now (I've disabled DrupalCI on this project and it will soon be disabled for all projects) it especially shouldn't be mixed in the same issue.

It also didn't help that it was posted next to #8, which is just the current MR as a patch for composer-patches (don't do that, use a local file). Doing that creates extra work for maintainers to sort out real contributions and set the credits correctly.

Note1: merge-plugin is no longer recommended and removed from the documentation, you're also comparing different versions.
Note2: asset-packagist is a project backed by single company based in Kiev, Ukraine. It is neat and convenient, but given the current situation (it was down for a day or so 1-2 years ago and nobody knew if it would come back), we and many others decided to not rely on it anymore. If it is gone, you are not deploying anymore until you switch to different approaches which might take quite some time.

Status: Fixed » Closed (fixed)

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