I used the drupal composer project and added the plupload module. I download the plupload lib and paste her in the library folder (web/libraries/plupload). The problem now is that plupload didn't found the plupload library. Are there any more steps nessesary to get plupload work?

Issue fork plupload-2902645

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Almare created an issue. See original summary.

jeffschuler’s picture

I added:

"plupload": {
     "type": "package",
     "package": {
          "name": "moxiecode/plupload",
          "version": "2.1.9",
          "type": "drupal-library",
          "source": {
               "url": "https://github.com/moxiecode/plupload.git",
               "type": "git",
               "reference": "v2.1.9"
          },
          "require": { "composer/installers": "~1.0" }
     }
}

...to the "repositories" section of my composer.json file,

making sure you have an entry like:

"web/libraries/{$name}": ["type:drupal-library"],

...in the "extra" : "installer-paths" section of composer.json, specifying the appropriate libraries directory.

Then ran composer require moxiecode/plupload.

I'm not sure if this is exactly the best way, but it worked. There's probably a simpler way to specify to get it from packagist (instead of github) but to still make it a "drupal-library" so it gets installed in the appropriate directory.

tormi’s picture

@jeffschuler, according to readme:

library version v2.0.0 and later are currently unsupported. Latest supported version of library is v1.5.8, which can be downloaded from https://github.com/moxiecode/plupload/archive/v1.5.8.zip

Composer settings with 1.5.8:

        {
          "type": "package",
          "package": {
            "name": "moxiecode/plupload",
            "version": "1.5.8",
            "type": "drupal-library",
            "extra": {
              "installer-name": "plupload"
            },
            "dist": {
              "url": "https://github.com/moxiecode/plupload/archive/v1.5.8.zip",
              "type": "zip"
            }
          }
        }

and

composer require moxiecode/plupload:1.5.8

jeffschuler’s picture

@tormi: That's the text from the project page, but that appears to not be true.

The 8.x README.txt says:
"1. Download it (version 2.1.1 or later) from..."

It looks like 2.x library compatibility was added in #2098555: Make compatible with plupload version 2.1.9.

tormi’s picture

Ok, good to know!

budalokko’s picture

Category: Support request » Task
Priority: Minor » Normal
FileSize
960 bytes

Attached patch adds a composer.json to the module.

Based on previous comments, it tries to add correct moxiecode plupload dependency. Ideally people installing the module would find library is also installed.

But I have no idea how to test this without commiting it to the repo, so only leaving it here as a patch by now.

I will also try to contact slashrsm so the project page is updated to reflect D8 status.
Project page was updated to reflect D8 status.

budalokko’s picture

Component: Documentation » Code
Status: Active » Needs review
hepabolu’s picture

I have applied the patch in #6 and the composer.json file was created, however the library was not downloaded automatically.

Kris77’s picture

I have the same issue too.

I have download module with composer, download library manually, but the module does not work...

Thanks.

EDIT: you must also download the module "Plupload_widget", but there are some issue.

Anonymous’s picture

composer require moxiecode/plupload

1) Should we update the module to reflect the vendor path, rather than be referencing the libraries folder path? Thus the libraries requirement would look for,

  js:
    /vendor/moxiecode/plupload/js/plupload.full.min.js: {}
    /vendor/moxiecode/plupload/js/jquery.plupload.queue/jquery.plupload.queue.min.js: {}
    plupload.js: {}

2) If we do go down this path then should we remove the examples folder from the /vendor/moxiecode/plupload/ folder via a post-package-install script?

marcoka’s picture

Priority: Normal » Major

It is not finding the lib at all: The Plupload library (version 2.1.9 or higher) is not installed.
I tried different versions above 2.1.9

My path is
/libraries/plupload/js/plupload.min
All files there. So not usable at all.

budalokko’s picture

@marcoka: If you placed your library by copy paste and not via composer I don't think your problem is the same they are talking about here.

In case your Drupal install dir has a /web/index.php file library should be placed at /web/libraries/plupload (for example this file should exist: /web/libraries/plupload/js/plupload.min.js) . If

In case you don't have a /web directory there and you have tried with a 2.1.9, just "the file is there" but still it doesn't find it, most probably it is a permissions issue on those directories / files. Maybe extracted files are only accessible by owner and web server user is not able to read them. Some chmod should solve this.

budalokko’s picture

Plupload has been added to Packagist, this simplifies the task to make plupload a composer-friendly module. The problem is "vendor" directory is not always into webroot so it is not always available through the webserver. More info here #3002647: Add a vendor:// stream wrapper.

Surprises me this Vendor Stream Wrapper module hasn't higher usage statistics but it seems the way to go. I'll wait a while if somebody comes up with a better idea and adapt the patch to the new situation otherwise.

marcoka’s picture

Priority: Major » Normal

Yes thanks. I was a bit fast here because i installed a lot of libs for a lot of modules and the only one failed was plupload.
It is a permission thing here.

johnnydarkko’s picture

In response to #6, update your `respositories` and `required` section of your root composer.json.

Example repositories section:

    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "1": {
            "type": "package",
            "package": {
                "name": "moxiecode/plupload",
                "version": "2.1.9",
                "type": "drupal-library",
                "source": {
                        "url": "https://github.com/moxiecode/plupload.git",
                        "type": "git",
                        "reference": "v2.1.9"
                },
                "require": { "composer/installers": "~1.0" }
            }
        }
    },

Then add
"moxiecode/plupload": "2.1.9",
to your required section.

HTH!

kellyimagined’s picture

Has anyone resolved this on Acquia Cloud? The issue is still there after following steps in #15.

budalokko’s picture

Title: Plupload library not found » Install via composer
Version: 8.x-1.x-dev » 2.1.x-dev
Status: Needs review » Needs work
budalokko’s picture

Status: Needs work » Needs review

I've done some work in an attempt to make installation of plupload module, plupload library and the examples clearing patch a bit quicker in composer-based workflows.

Would be great to get some feedback before committing this.

The proposed solution is based on adding a composer.libraries.json file to the module and use wikimedia/composer-merge-plugin and cweagans/composer-patches in main composer.json so all gets installed correctly.

So the instructions to test this would be the following. Step 1 won't be necessary once this is merged.

1. Instruct composer to use this issue's branch instead of default - The repositories section of your composer.json should end up with something like this:

    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": [
                "drupal/plupload"
            ]
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/plupload",
                "version": "dev-2902645-install-via-composer",
                "type": "drupal-module",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/plupload-2902645",
                    "reference": "2.1.x"
                }
            }
        }
    ],

2. Install cweagans/composer-patches and wikimedia/composer-merge-plugin

composer require cweagans/composer-patches wikimedia/composer-merge-plugin

3. Instruct merge plugin to use plupload composer.json. The "extra" section of composer.json should be like this:

    "extra": {
        "merge-plugin": {
            "include": [
                "web/modules/contrib/plupload/composer.libraries.json"
            ]
        }
    }

When visitting /admin/reports/status no error messages should appear in the "plupload library" section and the plupload widget should be visible in forms, of course.

  • budalokko committed c1b79b05 on 2.1.x
    Issue #2902645 by budalokko, tormi, jeffschuler, johnnydarkko: Install...
budalokko’s picture

Status: Needs review » Fixed

Created documentation on how to install plupload library via composer:

https://www.drupal.org/docs/extending-drupal/contributed-modules/contrib...

Updated readme with a reference to it.

Status: Fixed » Closed (fixed)

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