Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
views-app-folders.json_.txt | 963 bytes | pbuyle |
Comments
Comment #2
pbuyle CreditAttribution: pbuyle at Floe design + technologies commentedSame issue when requiring
"drupal/navbar": "1.7.*"
.This seems to be related to dependencies on libraries in the module's .info files.
Comment #3
pbuyle CreditAttribution: pbuyle at Floe design + technologies commentedComment #4
chr.fritschSame here with Drupal 8 Media Entity
Comment #5
chr.fritschI 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)
Comment #6
MixologicIt 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!
Comment #11
chr.fritschI've got a composer.json like this:
And got the following error:
Comment #12
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedIt is probably the version constraint in media_entity. http://cgit.drupalcode.org/media_entity/tree/media_entity.info.yml#n11
Comment #13
chr.fritschI have
in my composer.json, too.
Comment #14
MixologicAh 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
I'll work on a fix for this and let you know
Comment #15
MixologicAlso, 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.
Comment #16
MixologicIm 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
Comment #17
Mixologic