The installation of this module don't work with Dropzone 6. Dropzone 6 has no /min directory in dist, the .min.js files don't exist, they are replace by a file named dropzone-min.js in the dist directory.

Source : Dropzone Changelog

Issue fork dropzonejs-3295283

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

Soubi created an issue. See original summary.

heddn’s picture

Category: Bug report » Task
Status: Active » Needs review
StatusFileSize
new3.73 KB

This should also work with pre Dropzone version 6 as well. At least it worked for 5.9.3.

socialnicheguru’s picture

Will you also upgrade the composer.libraries.json file too?

Tim Cox made their first commit to this issue’s fork.

dineshreddymathuku’s picture

Hi After Adding all libraries and path its good to installable and latest version also looks good no issues i hope for this dropzonejs

loopy1492’s picture

StatusFileSize
new43.39 KB

https://github.com/enyo/dropzone now redirects to https://github.com/dropzone/dropzone.

I have added the following to my composer.json:


        "dropzone": {
            "type": "package",
            "package": {
                "name": "dropzone/dropzone",
                "version": "v6.0.0-beta.2",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/dropzone/dropzone/archive/refs/tags/v6.0.0-beta.2.zip",
                    "type": "tar"
                }
            }
        },

and


       "dropzone/dropzone": "v6.0.0-beta.2",

And we have applied your patch to drupal/dropzonejs (2.7.0), but we are still getting:

DROPZONE LIBRARY MISSING
Dropzonejs requires the dropzone.min.js library. Download it (https://github.com/enyo/dropzone) and place it in the libraries folder (/libraries)

When I run composer install, the dropzone library IS in the folder (see the screenshot).

What am I doing wrong?

loopy1492’s picture

Okay, I have switched to the "dist" version:

        "dropzone": {
            "type": "package",
            "package": {
                "name": "dropzone/dropzone",
                "version": "v6.0.0-beta.2",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "dropzone/dist"
                },
                "dist": {
                    "url": "https://github.com/dropzone/dropzone/releases/download/v6.0.0-beta.2/dist.zip",
                    "type": "zip"
                }
            }
        },

and now there is a /dist folder in the library. However, there is still no /min folder and there is no dropzone.min.js either.

Are we supposed to npm install this thing ourselves during ci or something?

loopy1492’s picture

StatusFileSize
new53.58 KB
loopy1492’s picture

Update: I had to manually delete the folder and now the proper dist zip is being extracted to the folder.

I highly recommend updating this module's readme to reflect the correct composer settings required to use this library.

Thanks

loopy1492’s picture

I spoke too soon. Even with the patch applying successfully and the correct library downloading to the folder, and several runs of drush cr, drush updb, and drush cron, the updates page is still reporting that the library cannot be found.

file

error

ikeigenwijs’s picture

Status: Needs review » Reviewed & tested by the community

#2 3295283.patch works for my finely got dropzone working after a lot of versions and sources in composer.

i dont have the library missing on status page

nils.destoop’s picture

The patch in #2 works for existing installs, but it fails when installing the module. The library definition does not exist yet during install.

nils.destoop’s picture

Status: Reviewed & tested by the community » Needs work

Berdir made their first commit to this issue’s fork.

berdir’s picture

Created a merge request with an updated version of the patch, lots of cleanup and tests, need to fix up some things as tests are now different between v5 and v6.

  • Berdir committed 164a0ce4 on 8.x-2.x
    Issue #3295283 by heddn: Installation not working with Dropzone 6
    
berdir’s picture

Status: Needs work » Fixed

Merged!

  • Berdir committed 06dfccbe on 8.x-2.x
     Issue #3295283 by Berdir: Fix Dropzone 6 version in README
    
benji07’s picture

If you're encountering issues with installing Dropzone on Drupal, an effective solution is to revert to version 2.8.0, as version 2.9.0 has been found to have some problems. To do this, you simply need to update your composer.json file to specify the desired version of the dependencies. Add the following lines to your composer.json under the require section:

"drupal/dropzonejs": "2.8.0",
"drupal/dropzonejs_eb_widget": "2.8.0"

This will force the use of version 2.8.0 for dropzonejs and dropzonejs_eb_widget, which has proven to be stable and free from the issues associated with version 2.9.0. Make sure to run composer update after making this change to apply the new versions.

berdir’s picture

It would be useful if you would create an issue to explain those "issues" and explain exactly how and where you have dropzone installed. This supports many different locations.

volkerk’s picture

@Berdir: Added follow-up for dist file detection.
#3424947: Fix detection of dropzonejs dist files for versions < 6

Status: Fixed » Closed (fixed)

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

therobyouknow’s picture

This is perhaps a great example for using import maps.

What exactly is an import map?

Answer:

This can be used to allow JS imports without having to specify the full path to the JS file.

- From: https://www.drupal.org/project/importmap

Import maps are available in Javascript and aren't a Drupal-specific concept; Javascript projects in general can use them.

Modules:

https://www.drupal.org/project/importmap (aforementioned)
https://www.drupal.org/project/importmaps