I am finding that installation via composer does not install the necessary library files from https://github.com/woothemes/FlexSlider

Is this normal?

Can I install the library files manually and still expect composer to work properly?

Possibly related https://www.drupal.org/node/2764431

Issue fork flexslider-2885268

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

MrPaulDriver created an issue. See original summary.

mrpauldriver’s picture

Issue summary: View changes
aburrows’s picture

Paul, are you still getting this? I'm probs going to get a patch done on this shortly, as I know I'll be using it on a project shortly.

aburrows’s picture

Quick fix is to change libraries yml to:

# Library definitions for flexslider module.
# The path to the actual FlexSlider library assets are defined in
# hook_library_alter_info.

integration:
  js:
    assets/js/flexslider.load.js: {}
    assets/js/jquery.flexslider-min.js: {}
  css:
    theme:
      assets/css/flexslider_img.css: {}
      assets/css/flexslider.css: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/drupalSettings
    - core/jquery.once
    - flexslider/flexslider

and then add the flexslider css and js into the module that way. Not ideal, but I'm going to get this fixed using composer and submit the patch.

mrpauldriver’s picture

Alex, still getting this as of yesterday. My needs are not immediate as only just starting to work with D8.

Thanks for tip about modifying yml file.

aburrows’s picture

Ok Paul, I'm using it in a book I'm writing so kinda need it fixed. Will be on it tomorrow

axlroach’s picture

Subscribe.

candelas’s picture

Hello

Could you create a composer.json for getting the libraries when installed, please? I have read the README.md, but it would be much easy to be able to install it without writing in composer.json.

Thanks :)

mrpauldriver’s picture

When I first posted this issue I was new to composer, and because it is supposed to a dependency manager I expected that it would install all the necessary dependencies.

For reasons I still don't fully understand (licensing maybe), it seems that composer doesn't install everything without additional configuration.

I have since discovered https://github.com/balbuf/drupal-libraries-installer

This fetches any required third party libraries, providing that you a have added a reference to them in your composer.json file.

candelas’s picture

Thanks @MrPaulDriver :) I will try it.
At the end I made in the project
composer require woothemes/flexslider:~2.0
and it worked.

candelas’s picture

@MrPaulDriver yesterday I was tired. What I did was to add in the composer.json (I don't write the Drupal lines for clarity and leave a blank line before what I wrote)

"repositories": [
        {

            "package": {
            "name": "woothemes/flexslider",
            "version": "2.6.3",
            "type": "drupal-library",
            "source": {
              "url": "https://github.com/woothemes/FlexSlider.git",
              "type": "git",
              "reference": "2.6.3"
            }
          }
        }
    ],
    "require": {
       
        "woothemes/flexslider": "~2.0"
    },



"extra": {
        "installer-paths": {

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


and in terminal

composer update

spanners’s picture

Can I add onto your snippet, @candelas?

I added the code to my composer.json and got an error.

[Composer\Json\JsonValidationException]
  "./composer.json" does not match the expected JSON schema:
   - repositories[1].package : Object value found, but a boolean is required
   - repositories[1].package : Does not have a value in the enumeration [false]
   - repositories[1].type : The property type is required
   - repositories[1].url : The property url is required
   - repositories[1] : Failed to match exactly one schema

So before the line "package": { I add the following:

"type": "package",

So the full block of code is...

{
   "type": "package",
   "package": {
     "name": "woothemes/flexslider",
     "version": "2.6.3",
     "type": "drupal-library",
     "source": {
       "url": "https://github.com/woothemes/FlexSlider.git",
       "type": "git",
       "reference": "2.6.3"
     },
     "require": {
       "woothemes/flexslider": "~2.0"
     }
   }
},

  • amaria committed 37b1ed1 on 8.x-2.x
    Issue #2885268: Composer does not seems to install the necessary library...
amaria’s picture

Status: Active » Fixed

I've updated to README. This should clarify composer install.

Status: Fixed » Closed (fixed)

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

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