When using a composer.json file containing the following:

{
  "repositories" :[
    ...
    {
      "type": "composer",
      "url": "https://packages.drupal.org/7"
    }
    ...
  ],
  require: {
    "drupal/views_app_folders": "1.0-dev"
  }
}

composer produce the following error:

  [RuntimeException]                                                                                                                
  Could not load package drupal/views_app_folders in https://packages.drupal.org/7: [UnexpectedValueException] Could not parse ver  
  sion constraint : Invalid version string ""

This happen when reading the file visible at https://packages.drupal.org/7/drupal/views_app_folders%241862e60cc530ab1... (copy attached to this issue).

The file does indeed contains an invalid version for the needed libraries module.

CommentFileSizeAuthor
views-app-folders.json_.txt963 bytespbuyle
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pbuyle created an issue. See original summary.

pbuyle’s picture

Same issue when requiring "drupal/navbar": "1.7.*".

This seems to be related to dependencies on libraries in the module's .info files.

pbuyle’s picture

Issue summary: View changes
chr.fritsch’s picture

Same here with Drupal 8 Media Entity

chr.fritsch’s picture

I could imagine that it breaks if a info file includes a dependency on a specific module version

views_app_folders and navbar:
dependencies[] = libraries (>=2.0)

media_entity:
dependencies:
- image
- user
- views
- entity (>=8.x-1.0-alpha3)
- system (>=8.1.0)

Mixologic’s picture

Assigned: Unassigned » Mixologic
Priority: Normal » Major

It looks like the composer_dependency code isnt handling version constraints like (2.x) properly (as seen in the libraries .info file). I'll work on a fix.

The media_entity issue is actually a separate issue that Im already working on, where core modules ended up taking over the package namespace from older versions of core.

Core used to have an entity module in it until the early alphas, which is now a separate project, so the requirements on the entity module dont match the core version constraints. I'll have a fix for that deployed this week.

Thanks for reporting these!

  • Mixologic committed d4f5e3b on 2726925-version-conversion
    Issue #2726925: Adds a more robust, tested, translation of drupal...

  • Mixologic committed 2e9fb7c on 2726925-version-conversion
    Issue #2726925: Adds the info file for the test
    

  • Mixologic committed a400b3d on 2726925-version-conversion
    Issue #2726925: Adds forward compatibility for composer semver...

  • Mixologic committed 2e9fb7c on 7.x-1.x
    Issue #2726925: Adds the info file for the test
    
  • Mixologic committed a400b3d on 7.x-1.x
    Issue #2726925: Adds forward compatibility for composer semver...
  • Mixologic committed d4f5e3b on 7.x-1.x
    Issue #2726925: Adds a more robust, tested, translation of drupal...
chr.fritsch’s picture

I've got a composer.json like this:

  "require": {
    "drupal/entity": "1.0-alpha3",
    "drupal/media_entity": "1.1",
    "drupal/media_entity_instagram": "1.0",
    "drupal/media_entity_image": "1.0",
    "drupal/media_entity_slideshow": "1.0",
    "drupal/media_entity_twitter": "1.0",
  }

And got the following error:

  Problem 1
    - Installation request for drupal/media_entity 1.1 -> satisfiable by drupal/media_entity[1.1.0].
    - drupal/media_entity 1.1.0 requires drupal/drupal ^1.0-alpha3 -> no matching package found.
  Problem 2
    - drupal/media_entity 1.1.0 requires drupal/drupal ^1.0-alpha3 -> no matching package found.
    - drupal/media_entity 1.0.x-dev requires drupal/drupal ^1.0-alpha3 -> no matching package found.
    - drupal/media_entity dev-1.0.x requires drupal/drupal ^1.0-alpha3 -> no matching package found.
    - drupal/media_entity dev-8.x-1.x requires drupal/entity >=8.1.0-alpha3 -> satisfiable by drupal/entity[8.1.0-alpha3] but these conflict with your requirements or minimum-stability.
    - drupal/media_entity 8.1.x-dev requires drupal/entity >=8.1.0-alpha3 -> satisfiable by drupal/entity[8.1.0-alpha3] but these conflict with your requirements or minimum-stability.
    - drupal/media_entity_twitter 1.0.0 requires drupal/media_entity * -> satisfiable by drupal/media_entity[8.1.x-dev, dev-8.x-1.x, dev-1.0.x, 1.0.x-dev, 1.1.0].
    - Installation request for drupal/media_entity_twitter 1.0 -> satisfiable by drupal/media_entity_twitter[1.0.0].
webflo’s picture

It is probably the version constraint in media_entity. http://cgit.drupalcode.org/media_entity/tree/media_entity.info.yml#n11

chr.fritsch’s picture

I have

"drupal/core": "8.1.1",

in my composer.json, too.

Mixologic’s picture

Status: Active » Needs work

Ah yes, definitely a bug. There is a check being performed to determine whether or not a module is part of "core", and if it is, to add a core dependency on that module. The issue in this case is that *very* early on, core had an entity module, so that code that determines if 'entity' is a core module is coming up true and creating an erroneous dependency

require: {
drupal/drupal: "^1.0-alpha3"
},

I'll work on a fix for this and let you know

Mixologic’s picture

Also, this would be mitigated if the media_entity module used the module namespace in its .info file:

- entity:entity (>=8.x-1.0-alpha3)

would allow the code to understand that it means the entity module in the entity *project*, and not the entity module in an old version of core.

Mixologic’s picture

Im actually marking this one as fixed, because the original report that had the blank libraries was fixed. The media issue is actually a separate bug. I've opened another issue there, @chr.fritsch please follow over here: #2744539: Ambiguous dependency declarations collide with core module namespaces

Mixologic’s picture

Status: Fixed » Closed (fixed)

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