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.
Comment | File | Size | Author |
---|---|---|---|
#11 | composer_file_should-2766303-11.patch | 737 bytes | morsok |
#5 | pathauto_2766303_composer_with_dependencies.patch | 748 bytes | Chandan Chaudhary |
Comments
Comment #2
Chandan Chaudhary CreditAttribution: Chandan Chaudhary as a volunteer and at Therefore commentedComment #3
Chandan Chaudhary CreditAttribution: Chandan Chaudhary as a volunteer and at Therefore commentedComment #4
borisson_why are these in require-dev, shouldn't this be in require?
Comment #5
Chandan Chaudhary CreditAttribution: Chandan Chaudhary as a volunteer and at Therefore commentedit was typo error, its better to have require instead of require-dev
Please find the updated patch.
Comment #6
borisson_Comment #7
miscellainiac CreditAttribution: miscellainiac commentedHi,
I'd like to point out that by putting these requirements in the composer.json, whenever I run composer drupal-update I get both ctools and token downloaded to my modules folder...which is not what I want since I put all contrib modules in a contrib subfolder under modules. I already had ctools and token there, but running composer drupal-update I get a second copy of each module.
If this needs to be a separate bug, I can log it, but figured the information belonged here.
Comment #8
BerdirYes, that's a problem specific to composer_manager, which is now deprecated and it is recommend to use composer directly to install modules. See https://www.drupal.org/node/2404989.
That said we recently removed the modules because previously, we hade drupal-packagist specific versions in there. Currently dependencies are auto-generated, but maybe only if there is no file at all.
I still don't know for sure what the process will be exactly, and if composer.json files should manually be added or not, at least for modules that do not require any non-drupal dependencies. So, waiting for now with committing this.
Comment #9
MixologicModule maintainers do not need composer.json files to express dependencies on other drupal modules, unless, for some reason having that module on the filesystem allows them to use it without it being a hard dependency (say, a module provides a cache backend class or something).
They can also use them if they want to have a more semverish compliant dependency specification. But for something like this where there are just *'s, you'd be fine without one.
Generally, unless you need external dependencies, you probably do not need a composer.json for your module.
Do *not* include
8.
in composer dependencies. That versioning is deprecated and will not work with packages.drupal.org/8That being said, *please* namespace your dependencies in your info.yml files, http://cgit.drupalcode.org/pathauto/tree/pathauto.info.yml#n7 should be ctools:ctools, drupal:path, and token:token.
Comment #10
morsokComment #11
morsokFollowing #9 I updated the namepaces in the .info.yml and removed the composer.json so D.O auto-generates one with dependencies.
Comment #12
BerdirComment #14
BerdirThanks, committed.
Comment #17
BerdirComment #18
XanoI recommend adding this back, as per Composer's own instructions. Without
composer.json
, Drupal extensions can only ever be installed through a Packagist service, and their code can only be autoloaded after Drupal has been bootstrapped, neither of which is a good thing, as extensions may need to be pulled in from other sources (VCS or path repositories), and code may need to be loaded without a Drupal bootstrap, such as during Behat runs.